Skip to content

A python package for the Linguistic Inquiry and Word Count (LIWC) dictionary.

License

Notifications You must be signed in to change notification settings

ilurirod/liwc-text-analysis-python

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status

LIWC Text Analysis - Python

A python package for the Linguistic Inquiry and Word Count (LIWC) dictionary. This package requires the proprietary LIWC dictionary file (.dic), that can be obtained from LIWC.net.

Usage

>>> from liwc import Liwc
>>> liwc = Liwc(LIWC_FILEPATH)
>>> # Search a word in the dictionary to find in which LIWC categories it belongs
>>> print(liwc.search('happy'))
['affect', 'posemo']
>>> # Extract raw counts of words in a document that fall into the various LIWC categories
>>> print(liwc.parse('I love ice cream.'.split(' ')))
Counter({'verb': 1, 'present': 1, 'affect': 1, 'posemo': 1, 'bio': 1, 'sexual': 1, 'social': 1})

Tests

The project comes with an extensive set of unit tests. The Pytest framework is used for unit testing. To run the tests use:
pytest

Project repository

https://github.com/evanll/liwc-text-analysis-python

Author

Written by Evan Lalopoulos evan.lalopoulos.2017@my.bristol.ac.uk

Evan Lalopoulos - evanll

About

A python package for the Linguistic Inquiry and Word Count (LIWC) dictionary.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 100.0%