A python package for the Linguistic Inquiry and Word Count (LIWC) dictionary.
Project description
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for liwc_text_analysis-1.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0d5d122781fd258a13463c9f135f7b53cc34b06dcf53dbe1e5adb3dd21c810bc |
|
MD5 | 1d32ce788896b5d20cc50da05850b951 |
|
BLAKE2b-256 | c03832f5c62dd39f07768587e2bc9a45bda5e767970d4d23dc6e7786b93267cd |