The cl-sentiment Reference Manual

Table of Contents

Next: , Previous: , Up: (dir)   [Contents][Index]

The cl-sentiment Reference Manual

This is the cl-sentiment Reference Manual, version 0.0.1, generated automatically by Declt version 2.4 "Will Decker" on Wed Jun 20 11:23:05 2018 GMT+0.


Next: , Previous: , Up: Top   [Contents][Index]

1 Introduction

cl-sentiment

cl-sentiment is a Common Lisp library that uses the AFINN-111 word list to perform sentiment analysis on arbitrary text.

Inspired by https://github.com/thisandagain/sentiment, it's particularly suited to looking at Twitter tweets.

The AFINN word list is by Finn Arup Nielsen available from http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6010

You might also like to read his paper:

"A new ANEW: Evaluation of a word list for sentiment analysis in microblogs", Proceedings of the ESWC2011 Workshop on 'Making Sense of Microposts': Big things come in small packages 718 in CEUR Workshop Proceedings : 93-98. 2011 May. http://arxiv.org/abs/1103.2903

The AFINN files are copyright protected and distributed under the terms of the Open Database License (ODbL) v1.0, http://www.opendatacommons.org/licenses/odbl/1.0/

cl-sentiment is now available via Quicklisp.

Use initialize to initialize cl-sentiment with the default sentiment word scores.

Call sentiment with some arbitrary text and it returns two values - the sentiment score and the comparative sentiment score. Positive values convey positive sentiment; negative values convey negative sentiment.

Example

CL-USER> (ql:quickload "cl-sentiment")
...
CL-USER> (cl-sentiment:initialize)
#<HASH-TABLE :TEST EQUAL :COUNT 2477 {1003A54463}>
CL-USER> (cl-sentiment:sentiment "Cats are totally amazing!")
4
1
CL-USER> 

Rob Blackwell

December 2012


Next: , Previous: , Up: Top   [Contents][Index]

2 Systems

The main system appears first, followed by any subsystem dependency.


Previous: , Up: Systems   [Contents][Index]

2.1 cl-sentiment

Author

Rob Blackwell

Description

A sentiment analysis library for Common Lisp.

Version

0.0.1

Dependencies
Source

cl-sentiment.asd (file)

Components

Next: , Previous: , Up: Top   [Contents][Index]

3 Files

Files are sorted by type and then listed depth-first from the systems components trees.


Previous: , Up: Files   [Contents][Index]

3.1 Lisp


Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.1 cl-sentiment.asd

Location

cl-sentiment.asd

Systems

cl-sentiment (system)


Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.2 cl-sentiment/package.lisp

Parent

cl-sentiment (system)

Location

package.lisp

Packages

cl-sentiment


Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.3 cl-sentiment/sentiment.lisp

Dependency

package.lisp (file)

Parent

cl-sentiment (system)

Location

sentiment.lisp

Exported Definitions
Internal Definitions

Previous: , Up: Lisp files   [Contents][Index]

3.1.4 cl-sentiment/tests.lisp

Dependency

sentiment.lisp (file)

Parent

cl-sentiment (system)

Location

tests.lisp


Next: , Previous: , Up: Top   [Contents][Index]

4 Packages

Packages are listed by definition order.


Previous: , Up: Packages   [Contents][Index]

4.1 cl-sentiment

Source

package.lisp (file)

Use List

common-lisp

Exported Definitions
Internal Definitions

Next: , Previous: , Up: Top   [Contents][Index]

5 Definitions

Definitions are sorted by export status, category, package, and then by lexicographic order.


Next: , Previous: , Up: Definitions   [Contents][Index]

5.1 Exported definitions


Previous: , Up: Exported definitions   [Contents][Index]

5.1.1 Functions

Function: initialize &optional FILENAME

Initializes cl-sentiment with a default word-score table.

Package

cl-sentiment

Source

sentiment.lisp (file)

Function: load-word-scores FILENAME

Loads a word score table from a tab separated file.

Package

cl-sentiment

Source

sentiment.lisp (file)

Function: sentiment TEXT &optional TABLE

Returns the sentiment measure for the given text.

Package

cl-sentiment

Source

sentiment.lisp (file)


Previous: , Up: Definitions   [Contents][Index]

5.2 Internal definitions


Next: , Previous: , Up: Internal definitions   [Contents][Index]

5.2.1 Special variables

Special Variable: *word-scores*
Package

cl-sentiment

Source

sentiment.lisp (file)


Previous: , Up: Internal definitions   [Contents][Index]

5.2.2 Functions

Function: words TEXT

Returns a list of words in the given text using simplistic tokenization.

Package

cl-sentiment

Source

sentiment.lisp (file)


Previous: , Up: Top   [Contents][Index]

Appendix A Indexes


Next: , Previous: , Up: Indexes   [Contents][Index]

A.1 Concepts

Jump to:   C   F   L  
Index Entry  Section

C
cl-sentiment.asd: The cl-sentiment<dot>asd file
cl-sentiment/package.lisp: The cl-sentiment/package<dot>lisp file
cl-sentiment/sentiment.lisp: The cl-sentiment/sentiment<dot>lisp file
cl-sentiment/tests.lisp: The cl-sentiment/tests<dot>lisp file

F
File, Lisp, cl-sentiment.asd: The cl-sentiment<dot>asd file
File, Lisp, cl-sentiment/package.lisp: The cl-sentiment/package<dot>lisp file
File, Lisp, cl-sentiment/sentiment.lisp: The cl-sentiment/sentiment<dot>lisp file
File, Lisp, cl-sentiment/tests.lisp: The cl-sentiment/tests<dot>lisp file

L
Lisp File, cl-sentiment.asd: The cl-sentiment<dot>asd file
Lisp File, cl-sentiment/package.lisp: The cl-sentiment/package<dot>lisp file
Lisp File, cl-sentiment/sentiment.lisp: The cl-sentiment/sentiment<dot>lisp file
Lisp File, cl-sentiment/tests.lisp: The cl-sentiment/tests<dot>lisp file

Jump to:   C   F   L  

Next: , Previous: , Up: Indexes   [Contents][Index]

A.2 Functions

Jump to:   F   I   L   S   W  
Index Entry  Section

F
Function, initialize: Exported functions
Function, load-word-scores: Exported functions
Function, sentiment: Exported functions
Function, words: Internal functions

I
initialize: Exported functions

L
load-word-scores: Exported functions

S
sentiment: Exported functions

W
words: Internal functions

Jump to:   F   I   L   S   W  

Next: , Previous: , Up: Indexes   [Contents][Index]

A.3 Variables

Jump to:   *  
S  
Index Entry  Section

*
*word-scores*: Internal special variables

S
Special Variable, *word-scores*: Internal special variables

Jump to:   *  
S  

Previous: , Up: Indexes   [Contents][Index]

A.4 Data types

Jump to:   C   P   S  
Index Entry  Section

C
cl-sentiment: The cl-sentiment system
cl-sentiment: The cl-sentiment package

P
Package, cl-sentiment: The cl-sentiment package

S
System, cl-sentiment: The cl-sentiment system

Jump to:   C   P   S