API Reference#

I/O#

Reading, writing, and merging LIWC dictionaries.

create_dx(categories)

Create a dictionary DataFrame from category-to-terms mapping.

read_dx(fp, **kwargs)

Read a dictionary from a LIWC DIC or DICX file.

write_dx(dx, fp, **kwargs)

Write a dictionary to a LIWC DIC or DICX file.

merge_dx(*dxs)

Merge multiple dictionaries into a single dictionary.

drop_category(dx, categories)

Remove one or more categories from a dictionary.

LIWC-22 CLI#

Python wrapper for the LIWC-22 command-line tool.

liwc22(mode, *[, auto_open, use_gui, dry_run])

Execute a LIWC-22 CLI analysis from Python.

Word Counting#

Pure-Python LIWC-style word counting.

count(-> ~pandas.DataFrame)

Count LIWC dictionary categories across documents (pure-Python).

DDR Scoring#

Distributed Dictionary Representation — semantic scoring via word embeddings.

ddr(texts, dx, embeddings, *[, tokenizer, ...])

Score documents against dictionary categories via DDR.

Fetching Dictionaries#

Remote LIWC-format dictionaries, fetched on demand and cached locally.

fetch_bigtwo(*[, version])

Fetch the big two (agency and communion) dictionary.

fetch_honor()

Fetch the honor dictionary.

fetch_mystical()

Fetch the mystical experience dictionary.

fetch_sleep()

Fetch the sleep dictionary.

fetch_threat()

Fetch the threat dictionary.

Utility#

Miscellaneous utilities and helpers.

set_log_level([level])

Configure logging output for the liwca package.