Skip to main content

PsychiatryNLPKit

CEYMH Research Group at McGill University

CI PyPI version Python 3.11+ License: MIT Documentation

A scientific Python package for computational linguistics analysis of clinical data in psychiatry. It is developed in the CEYMH / Douglas Research Group at McGill University and provides a curated set of linguistic metrics across seven analytical categories, each grounded in peer-reviewed research on psychosis risk assessment and thought disorder characterization.


Overview

PsychiatryNLPKit is designed for researchers and clinicians who need to extract validated computational linguistics features from spoken or written clinical text. The package implements analysis functions derived from the scientific literature on language markers of psychosis, including formal thought disorder, disorganization, and cognitive impairment.

The toolkit supports English and French text and provides metrics spanning:

Category What it measures
Syntax POS ratios, clause structure, syntax tree depth, sentence complexity
Similarity Semantic coherence via adjacent word/sentence cosine similarity
Perplexity Language model perplexity at paragraph and sentence levels (generative + masked LM)
Graph Network metrics from structural word-transition graphs (nodes, edges, diameter, z-scores)
Density Semantic space dimensionality via PCA explained variance, intrinsic dimension estimation, vector-unpacking semantic density, and propositional idea density
Lexicon Disfluency and filler word frequency
ImageSimilarity Cross-modal cosine similarity between images and arbitrary text sections using multimodal embeddings

Each function accepts pre-computed linguistic data from the TextData container and returns a dictionary mapping section names to numeric metric values. This modular design lets you compose analyses flexibly or run them all at once via the batch API.

Design principles

  • Scientific grounding -- analysis functions are based on the psychiatry research literature. This package implements speech metrics that have been shown to correlate with clinical rating scales (PANSS, TLC, TLI).
  • Batch efficiency -- expensive computations (tokenization, embedding, constituency parsing) are lazy-loaded and cached on the TextData container. Running multiple analyses over the same text incurs no redundant work.
  • Hardware acceleration -- all deep learning pipelines run on CUDA, MPS (Apple Silicon), or Intel XPU when available, with automatic fallback to CPU.
  • Composable architecture -- individual analysis functions can be called standalone, or orchestrated together via BatchAnalyzer. The same TextData object serves all analyses.

Quick Start

The high-level batch API processes an entire corpus in a few lines:

import logging
import PsychiatryNLPKit as pnlp
from PsychiatryNLPKit.data import Section, TextData
from PsychiatryNLPKit.model import HFEmbeddingLLM, HFGenerativeLLM

# 1. Configure logging (optional but recommended)
pnlp.configure_logging(level=logging.INFO)

# 2. Load your text data from a file or database. Organize the dataset into different sections for separate analysis.
sections = [
    Section(text="I work in a factory that produces humanoid robots. The assembly line runs all day.", name="Paragraph 1"),
    Section(text="I just came back from a vacation in the mountains. The weather was calm and cool.", name="Paragraph 2"),
]
data = TextData(sections=sections, lang="en")

# 3. Attach models (lazy-loaded on first use)
data.embedding_model = HFEmbeddingLLM("unsloth/embeddinggemma-300m")
data.generative_model = HFGenerativeLLM("unsloth/Llama-3.2-1B")

# 4. Run analyses (exclude analyses that require additional models)
result = pnlp.BatchAnalyzer(
    data,
    excluded_analyses=[
        "paragraph_level_pseudo_perplexity",  # requires mask-filling model
        "sentence_level_pseudo_perplexity",
        "structural_graph",  # requires networkx extra
        "image_text_similarity",  # requires pillow extra and image paths
    ],
).run()

# 5. Inspect results
print(result.sections)          # ['Paragraph 1', 'Paragraph 2']
print(result.analyses_run)      # list of successfully executed function names
print(result.results["Paragraph 1"])     # {'sentence_length': 12.5, 'adverb_ratio': 0.08, ...}

# 6. Export to CSV for downstream statistical analysis
import csv
with open("results.csv", "w", newline="") as f:
    writer = csv.writer(f)
    writer.writerow(["section"] + list(result.results["Paragraph 1"].keys()))
    for section in result.sections:
        writer.writerow([section] + [result.results[section].get(k, float("nan"))
                                     for k in result.results["Paragraph 1"].keys()])

Single analyses (TextData.compute)

For targeted analysis or custom pipelines, run individual analyses by name. Each call resolves the required TextData property, language, and models automatically from the analysis registry:

from PsychiatryNLPKit.data import Section, TextData
from PsychiatryNLPKit.model import HFEmbeddingLLM, HFGenerativeLLM

sections = [Section(text="The quick brown fox jumps over the lazy dog. Birds watch from the fence.", name="Paragraph 1")]
data = TextData(sections=sections, lang="en")

# Attach models (lazy-loaded on first use)
data.embedding_model = HFEmbeddingLLM("unsloth/embeddinggemma-300m")
data.generative_model = HFGenerativeLLM("unsloth/Llama-3.2-1B")

# Syntax: sentence length
lengths = data.compute("sentence_length")
# → {"Paragraph 1": {"sentence_length": 10.0}}

# Semantic coherence: adjacent sentence similarity
coherence = data.compute("sentence_level_cosine_similarity")
# → {"Paragraph 1": {"sentence_level_cosine_similarity": 0.73}}

# Perplexity: generative model on paragraphs
perplexity = data.compute("paragraph_level_perplexity")
# → {"Paragraph 1": {"paragraph_level_perplexity": 42.5}}

# Graph: structural word-transition network metrics (requires [graph] extra)
graph_metrics = data.compute("structural_graph")
# → {"Paragraph 1": {"nodes_count": 8.0, "edges_count": 9.0, ...}}

# Density: PCA-based semantic space compression (uses token-level embeddings)
density = data.compute("pca_density_metrics")
# → {"Paragraph 1": {"Ncomp_90": 3.0, "Pcomp_90": 0.375, "ExVar_2": 0.45}}

# Density: propositional idea density (POS-based, no model required)
pid = data.compute("propositional_idea_density")
# → {"Paragraph 1": {"propositional_idea_density": 42.7, "proposition_count": 34.0, "word_count": 80.0}}

# Lexicon: filler word disfluency count
fillers = data.compute("filler_words_count")
# → {"Paragraph 1": {"filler_words_count": 0, "filler_words_ratio": 0.0}}

See PsychiatryNLPKit.analysis.ALL_ANALYSES for the full list of registered analysis names.


Installation

From PyPI

pip install PsychiatryNLPKit              # core package
pip install PsychiatryNLPKit[graph]       # + networkx (for structural_graph)
pip install PsychiatryNLPKit[image]       # + pillow, torchvision (for image_text_similarity)
pip install PsychiatryNLPKit[dev]         # + pytest, pyright, sphinx (for development)

# All extras at once:
pip install PsychiatryNLPKit[graph,image,dev]

From source

git clone https://github.com/rukun-dou/PsychiatryNLPKit.git
cd PsychiatryNLPKit
pip install -e ".[graph,image,dev]"

Requirements: Python 3.11+, Hugging Face token (for gated models). Set the HF_TOKEN environment variable before loading any model that requires authentication.


Configuration

Device detection

PsychiatryNLPKit automatically detects and uses the fastest available hardware:

CUDA (NVIDIA) → MPS (Apple Silicon) → Intel XPU → CPU
from PsychiatryNLPKit import device, hf_token

print(device)        # torch.device('cuda') or 'mps' or 'cpu'
print(hf_token)      # str | None  (read from HF_TOKEN env var)

Models are loaded with bfloat16 precision on GPUs for memory efficiency and faster inference. All deep learning computations (tokenization, embedding generation, perplexity scoring, image-text similarity) run on the detected device.

Logging

import logging
import PsychiatryNLPKit as pnlp

pnlp.configure_logging(level=logging.DEBUG)  # default is INFO

The package uses a dedicated logger (PsychiatryNLPKit) with propagate=False, so messages won't interfere with your application's root logger. Calling configure_logging multiple times is safe (duplicate handlers are guarded against).


Data Model

TextData

The central container for all analysis. It holds raw text sections and computes linguistic properties lazily on first access, caching results to avoid redundant computation:

from PsychiatryNLPKit.data import Section, TextData

sections = [
    Section(text="First paragraph contains two sentences. It is long enough for analysis.", name="Paragraph 1"),
    Section(text="Second paragraph also has two sentences. It gives the model more context.", name="Paragraph 2"),
]
data = TextData(sections=sections, lang="en")
Property Requires model Returns Description
data No dict[str, str] Raw section text keyed by name
sentences No dict[str, list[str]] Sentences per section (regex-split)
pos_tags No dict[str, list[list[tuple[str,str,str]]]] POS-tagged sentences: (word, lemma, tag) tuples
syntax_trees No dict[str, list[benepar.Tree]] Constituency parse trees per sentence
token_embedding_vectors embedding_model dict[str, torch.Tensor] Token-level embeddings, shape (n_tokens, dim)
attention_scores embedding_model dict[str, torch.Tensor] Aggregated attention scores, shape (n_tokens, n_tokens)
sentence_embedding_vectors embedding_model dict[str, torch.Tensor] Sentence-level embeddings, shape (n_sentences, dim)
content_words No dict[str, list[str]] Content words (nouns, verbs, adjectives, adverbs) per section
content_word_embedding_vectors No dict[str, list[torch.Tensor]] Word2Vec embeddings for content words per sentence, each tensor shape (n_words, dim)
paragraph_generative_tokens generative_model dict[str, dict[str, torch.Tensor]] Tokenized paragraphs (input_ids + attention_mask)
sentence_generative_tokens generative_model dict[str, dict[str, torch.Tensor]] Tokenized sentences
section_names No list[str] Ordered list of section names

Section

A named text segment:

from PsychiatryNLPKit.data import Section

section = Section(
    text="Clinical interview transcript begins here. The participant describes recent stressors.",
    name="Paragraph 1",
)

Each section has a text attribute (the raw string) and an optional name used as the dictionary key in all analysis outputs. If no name is provided, sections are auto-named section_0, section_1, etc.

ImageData

For image-text similarity analysis:

from PsychiatryNLPKit.data import ImageData

image = ImageData(path="patient_response.jpg", name="Paragraph 1")
# Access via image.image → PIL.Image.Image (lazy-loaded)

ImageData is a convenience container for single-image use. The batch API takes a plain {section_name: path} dict via image_paths instead (see above).


Batch Analysis

BatchAnalyzer is the high-level orchestrator. It runs selected analyses on a TextData object and collects all results into a single structured container:

from PsychiatryNLPKit.analysis import BatchAnalyzer, AnalysisResult
from PsychiatryNLPKit.model import HFMaskFillingModel, HFMultimodalEmbeddingModel

# Attach the remaining models (lazy-loaded on first use)
data.mask_filling_model = HFMaskFillingModel("LiquidAI/LFM2.5-Encoder-350M")
data.vit_model = HFMultimodalEmbeddingModel("Qwen/Qwen3-VL-Embedding-2B")

# Run every analysis (requires all four models attached)
result = BatchAnalyzer(
    data,
    image_paths={"Paragraph 1": "img1.jpg", "Paragraph 2": "img2.jpg"},  # per-section images
).run()

# Run a subset
result = BatchAnalyzer(
    data,
    included_analyses=["sentence_length", "adverb_ratio", "filler_words_count"],
).run()

# Exclude specific analyses from the full set
result = BatchAnalyzer(
    data,
    included_analyses="all",
    excluded_analyses=[
        "paragraph_level_pseudo_perplexity",  # requires mask-filling model
        "sentence_level_pseudo_perplexity",
        "structural_graph",  # requires networkx extra
        "image_text_similarity",  # requires pillow extra and image paths
    ],
).run()

Note: included_analyses="all" requires all four models attached (embedding_model, generative_model, mask_filling_model, vit_model). Analyses whose models are missing raise an AssertionError at construction, so use excluded_analyses to skip them (as in the Quick Start example).

Parameters

Parameter Type Description
text_data TextData The data container with sections and required models attached (see TextData.compute)
included_analyses "all" or list[str] Default "all" runs every registered analysis. Pass an explicit list for a subset
excluded_analyses list[str] | None Function names to remove from the inclusion set. Every excluded name must be in the resolved inclusion list; otherwise an AssertionError is raised
image_paths dict[str, str] | None Maps section name → image file path. Must cover every section in text_data.section_names when image analysis is requested

Image-text similarity in batch mode

image_text_similarity needs the [image] extra, a multimodal embedding model, and one image path per section:

pip install "PsychiatryNLPKit[image]"
from PsychiatryNLPKit.data import Section, TextData
from PsychiatryNLPKit.model import HFMultimodalEmbeddingModel
from PsychiatryNLPKit.analysis import BatchAnalyzer

sections = [
    Section(text="The patient drew a house with a large sun.", name="Paragraph 1"),
    Section(text="The drawing shows a family in front of the house.", name="Paragraph 2"),
]
data = TextData(sections=sections, lang="en")
data.vit_model = HFMultimodalEmbeddingModel("Qwen/Qwen3-VL-Embedding-2B")

result = BatchAnalyzer(
    data,
    included_analyses=["image_text_similarity"],
    image_paths={
        "Paragraph 1": "drawing_1.jpg",  # keys must match section names exactly
        "Paragraph 2": "drawing_2.jpg",
    },
).run()

image_paths must contain an entry for every section in data.section_names; missing entries raise an AssertionError. Each value is a path to an image file (PIL image objects are also accepted).

AnalysisResult

Attribute Type Description
results dict[str, dict[str, float]] Merged per-section metrics keyed by section name, then metric name
sections list[str] Section names in order (from TextData.section_names)
analyses_run list[str] Names of analyses that executed successfully
errors dict[str, str] Per-function failures: {function_name: error_message}

Analysis Functions Reference

Every analysis below is invoked by name through TextData.compute(name), which resolves the required input automatically (see "Single analyses" above). The "Required input" column documents what each underlying function consumes.

All functions accept a sections parameter (list[str] \| None) to restrict processing to specific sections. When None, all available sections are processed. Empty or missing sections receive float("nan"). Language-dependent functions support "en" and "fr".

Syntax (pnlp.analysis.Syntax) — 13 functions

Measures of sentence structure, part-of-speech distributions, and syntax tree complexity derived from clinical research on thought disorder.

Function Required input Returns Clinical basis
sentence_length pos_tags {section: {"sentence_length": float}} Poverty of content (Bilgrami et al., 2022)
syntax_depth syntax_trees {section: {"syntax_depth": float}} Reduced complexity predicts psychosis onset (Morice & Ingram, 1983)
unique_pos_tags pos_tags {section: {"unique_pos_tags": int}} Linguistic diversity marker
adverb_ratio pos_tags, lang {section: {"adverb_ratio": float, "adverb_count": int}} Associated with negative symptoms (Haas et al., 2020)
coordinating_conjunction_ratio pos_tags, lang {section: {"coordinating_conjunction_ratio": float}} Negative symptom correlation (Haas et al., 2020)
adjective_ratio pos_tags, lang {section: {"adjective_ratio": float}}
pronoun_ratio pos_tags, lang {section: {"pronoun_ratio": float}} Correlates with disorganization symptoms (He et al., 2024)
determiner_ratio pos_tags, lang {section: {"determiner_ratio": float}} Negative thought disorder marker (Bilgrami et al., 2022)
modal_auxiliary_verb_ratio pos_tags, lang {section: {"modal_auxiliary_verb_ratio": float}}
stop_words_ratio pos_tags, lang {section: {"stop_words_ratio": float}} Baseline lexical measure
clause_count syntax_trees {section: {"clause_count": int}} Psychosis onset prediction (Bilgrami et al., 2022)
noun_group_count syntax_trees {section: {"noun_group_count": int}}
adjective_sentence_length syntax_trees {section: {"adjective_sentence_length": float}}

POS tag aliases support both Penn Treebank (JJ, NN, RB) and Universal Dependencies (ADJ, NOUN, ADV) schemes.

Similarity (pnlp.analysis.Similarity) — 2 functions

Cosine similarity between adjacent embeddings to quantify semantic coherence:

Function Required input Returns Clinical basis
word_level_cosine_similarity content_word_embedding_vectors {section: {"word_level_cosine_similarity": float}} Correlated with tangentiality, circumstantiality, derailment (Bilgrami et al., 2022; Elvevag et al., 2007; He et al., 2024)
sentence_level_cosine_similarity sentence_embedding_vectors {section: {"sentence_level_cosine_similarity": float}} Detects incoherent speech in formal thought disorder (same references)

Perplexity (pnlp.analysis.Perplexity) — 4 functions

Language model perplexity at paragraph and sentence levels using both generative (causal LM) and masked language models:

Function Model type Required input Returns Clinical basis
paragraph_level_perplexity Generative (causal LM) paragraph_generative_tokens, generative_model {section: {"paragraph_level_perplexity": float}} High perplexity predicts delusion and unusual thought content (Alqahtani et al., 2022; He et al., 2024)
sentence_level_perplexity Generative (causal LM) sentence_generative_tokens, generative_model {section: {"sentence_level_perplexity": float}} Same references
paragraph_level_pseudo_perplexity Masked LM data.data (raw text), mask_filling_model {section: {"paragraph_level_pseudo_perplexity": float}} Same references
sentence_level_pseudo_perplexity Masked LM data.data (raw text), mask_filling_model {section: {"sentence_level_pseudo_perplexity": float}} Same references

Graph (pnlp.analysis.Graph) — 1 function

Constructs a directed, weighted word-transition graph from lemmatized content words and computes network metrics:

Function Required input Returns Clinical basis
structural_graph content_words {section: {nodes_count, edges_count, average_degree, density, diameter, average_shortest_path_length, largest_connected_component, largest_strongly_connected_component, lcc/n, lsc/n, edge_weight_repetition_index, lcc_z_score, lsc_z_score, aspl_z_score, degree_distribution_z_score}} Schizophrenia patients show smaller connected components and lower ASPL (Nikzad et al., 2022)

Parameters: directed=True, weighted=True, n_random_graphs=1000 (for z-score computation against a null distribution).

Density (pnlp.analysis.Density) — 4 functions

Measures of semantic space dimensionality derived from embeddings, plus propositional idea density:

Function Required input Returns Clinical basis
pca_density_metrics token_embedding_vectors {section: {Ncomp_90, Pcomp_90, ExVar_2}} Schizophrenia patients show altered semantic compressibility (Palominos et al., 2025)
intrinsic_dimensionality_density token_embedding_vectors {section: {ID_MLE}} Lower intrinsic dimensionality indicates more redundant speech (same reference)
vector_unpacking_density content_word_embedding_vectors {section: {semantic_density, semantic_density_std, mean_meaning_components, mean_content_words}} Low semantic density predicts conversion to psychosis and correlates with negative symptoms (Rezaii et al., 2019)
propositional_idea_density pos_tags, lang {section: {propositional_idea_density, proposition_count, word_count}} Lower PID is associated with cognitive decline and dementia risk (Hill et al., 2021)

PCA is applied in token space (features = tokens, i.e. X.T) so metrics reflect how many token directions are needed to explain semantic variance. Total paragraph length must be controlled during statistical analysis.

vector_unpacking_density implements the vector unpacking algorithm: sentence vectors (normalized sums of content-word embeddings) are decomposed into a linear combination of their word embeddings by gradient descent, and the number of meaning components (high-weight embeddings, selected by F-ratio partitioning) divided by the number of content words gives the sentence density. Total paragraph length must be controlled during statistical analysis.

propositional_idea_density counts elementary predications following the CPIDR rule set (Brown et al., 2008): each verb (excluding copular and auxiliary "be" and modals), adjective, adverb, preposition, and conjunction contributes one proposition, and universal quantifiers contribute one as well. PID is reported per 100 words.

Lexicon (pnlp.analysis.Lexicon) — 2 functions

Function Required input Returns Clinical basis
filler_words_count pos_tags, lang {section: {filler_words_count, filler_words_ratio}} Disfluencies correlate with symptom severity and PANSS negative scores (Vail et al., 2018; Liebenthal et al., 2022)
zipf_frequency pos_tags, lang {section: {zipf_frequency_mean, zipf_frequency_std}}

Filler word lists are loaded from the packaged resources/filler_words.json resource. The averaging_method parameter controls computation: "macro" averages per-sentence filler ratios, "micro" computes total fillers / total words across the section (default: "macro").

zipf_frequency looks up each word's lemma in the wordfreq database (English and French); unrecognized lemmas are excluded from the mean and standard deviation.

ImageSimilarity (pnlp.analysis.ImageSimilarity) — 1 function

Function Required input Returns Clinical basis
image_text_similarity image, text, vit_model {section: {"image_text_similarity": float}} Lower multimodal embedding similarity predicts higher conceptual disorganization (He et al., 2024)

The image argument accepts a PIL Image object or a file path. Text and images are encoded with a SentenceTransformer multimodal model, then compared with cosine similarity.


Model Wrappers

All models use lazy loading: the underlying Hugging Face model is downloaded and loaded only when first accessed. Models are unloaded after each compute() call (or at the end of a BatchAnalyzer run) to free GPU memory.

Class Purpose Example model ID
HFEmbeddingLLM Sentence/word embedding models unsloth/embeddinggemma-300m
HFGenerativeLLM Autoregressive causal LMs unsloth/Llama-3.2-1B
HFMaskFillingModel Masked language models LiquidAI/LFM2.5-Encoder-350M
HFMultimodalEmbeddingModel Multimodal embedding model Qwen/Qwen3-VL-Embedding-2B
from PsychiatryNLPKit.model import HFEmbeddingLLM, HFGenerativeLLM, HFMaskFillingModel, HFMultimodalEmbeddingModel

embedding = HFEmbeddingLLM("unsloth/embeddinggemma-300m")
embedding.load()
# embedding.model.encode(...)  # use the underlying model directly
embedding.unload()  # frees GPU memory

vit_model = HFMultimodalEmbeddingModel("Qwen/Qwen3-VL-Embedding-2B")
vit_model.load()
# vit_model.model.encode([image, text], convert_to_tensor=True)
vit_model.unload()

Data Formats

Input: Text sections

The primary input is a list of Section objects, each containing raw text and an optional name. Sections can represent individual interview responses, paragraphs from clinical notes, or any other text unit.

For batch processing from files, a typical workflow looks like:

import csv
from PsychiatryNLPKit.data import Section, TextData

# Read from CSV: columns "id", "text"
sections = []
with open("clinical_corpus.csv", newline="") as f:
    reader = csv.DictReader(f)
    for index, row in enumerate(reader, start=1):
        sections.append(Section(text=row["text"], name=f"Paragraph {index}"))

data = TextData(sections=sections, lang="en")

Output: AnalysisResult

The AnalysisResult container provides three access patterns:

# By section → metric
result.results["Paragraph 1"]["sentence_length"]  # 12.5

# Export to pandas DataFrame for statistical analysis
import pandas as pd
records = []
for section in result.sections:
    record = {"section": section}
    record.update({k: v for k, v in result.results[section].items()})
    records.append(record)
df = pd.DataFrame(records)

# Check for failures
if result.errors:
    print("Failed analyses:", result.errors)

Project Structure

PsychiatryNLPKit/
├── src/
│    └── PsychiatryNLPKit/
│         ├── config.py                  # Device detection, logging setup, HF token
│         ├── data/
│         │    ├── Text.py                # Section, TextData (lazy-computed properties)
│         │    ├── Image.py               # ImageData container
│         │    ├── Audio.py               # Placeholder for future audio processing
│         │    └── _resources.py          # SQLite-backed WordEmbeddingStore, stopwords
│         ├── model/
│         │    ├── LLM.py                 # BaseLLM, HuggingFaceLLM, HFEmbeddingLLM, HFGenerativeLLM, HFMaskFillingModel
│         │    └── ViT.py                 # HuggingFaceViTModel, HFMultimodalEmbeddingModel
│         ├── analysis/
│         │    ├── Syntax.py              # 13 syntax functions
│         │    ├── Similarity.py          # 2 similarity functions
│         │    ├── Perplexity.py          # 4 perplexity functions
│         │    ├── Graph.py                # structural_graph (network metrics + z-scores)
│         │    ├── Density.py             # PCA density, intrinsic dimensionality, propositional idea density
│         │    ├── Lexicon.py             # Filler word disfluency analysis
│         │    ├── ImageSimilarity.py     # multimodal image-text similarity
│         │    └── batch.py               # BatchAnalyzer, AnalysisResult
│         └── resources/
│              ├── filler_words.json      # EN/FR filler word lists
│              └── word2vec.db            # SQLite database with Zstd-compressed embeddings
└── tests/                                # Unit and integration tests

BibTeX Citation

If you use PsychiatryNLPKit in your research, please cite:

@software{psychiatrynlpkit2026,
  author = {Dou, Rukun and Wei, Tiana and Voppel, Alban Elias and Palaniyappan, Lena},
  title = {PsychiatryNLPKit: Computational linguistics toolkit for psychosis risk assessment and thought disorder analysis},
  year = {2026},
  url = {https://github.com/rukun-dou/PsychiatryNLPKit},
  version = {0.1.7},
  license = {MIT}
}

References

All analysis functions include their theoretical basis and primary references in their docstrings. Key publications underpinning this toolkit:

  • Alqahtani, A., Kayi, E. S., Hamidian, S., Compton, M., & Diab, M. (2022). A quantitative and qualitative analysis of schizophrenia language. Proceedings of the 13th International Workshop on Health Text Mining and Information Analysis (LOUHI), 173–183.
  • Bilgrami, Z. R., et al. (2022). Construct validity for computational linguistic metrics in individuals at clinical risk for psychosis. Schizophrenia Research, 245, 90–96.
  • Elvevåg, B., Foltz, P. W., Weinberger, D. R., & Goldberg, T. E. (2007). Quantifying incoherence in speech: An automated methodology and novel application to schizophrenia. Schizophrenia Research, 93(1-3), 304–316.
  • Haas, S. S., Doucet, G. E., Garg, S., Herrera, S. N., Sarac, C., Bilgrami, Z. R., Shaik, R. B., & Corcoran, C. M. (2020). Linking language features to clinical symptoms and multimodal imaging in individuals at clinical high risk for psychosis. European Psychiatry, 63(1), e72.
  • He, R., Palominos, C., Zhang, H., Alonso-Sánchez, M. F., Palaniyappan, L., & Hinzen, W. (2024). Navigating the semantic space: Unraveling the structure of meaning in psychosis using different computational language models. Psychiatry Research, 333, 115752.
  • Hill, E., et al. (2021). Propositional idea density and cognitive decline.
  • Liebenthal, E., et al. (2022). Linguistic and non-linguistic markers of disorganization in psychotic illness. Schizophrenia Research, 259, 111–120.
  • Morice, R. D., & Ingram, J. C. (1983). Language complexity and age of onset of schizophrenia. Psychiatry Research, 9(3), 233–242.
  • Nikzad, A. H., et al. (2022). Who does what to whom? graph representations of action-predication in speech relate to psychopathological dimensions of psychosis. Schizophrenia, 8(1), 58.
  • Rezaii, N., Walker, E., & Wolff, P. (2019). A machine learning approach to predicting psychosis using semantic density and latent content analysis. npj Schizophrenia, 5, 9.
  • Palominos, C., et al. (2025). Lexical meaning is lower dimensional in psychosis. Scientific Reports, 16(1), 859.
  • Vail, A. K., Liebson, E., Baker, J. T., & Morency, L.-P. (2018). Toward objective, multifaceted characterization of psychotic disorders: Lexical, structural, and disfluency markers of spoken language. Proceedings of the 20th ACM International Conference on Multimodal Interaction, 170–178.

Funding

This work was supported by the FRQS Partenariat Innovation-Québec-Janssen (PIQ-J) initiative (#338282), the FRQS Alliance en santé mentale grant (#348797 to Douglas Research Centre), CIHR SPOR (PJK192157), CIHR Project Grant (PJT195903), Wellcome Trust Discretionary Grant (226168/Z/22/Z), and Wellcome Trust Mental Health Award for the DIALOG consortium (314138/Z/24/Z). L. Palaniyappan is supported by the Monique H. Bourgeois Chair in Developmental Disorders and the Graham Boeckh Foundation, and holds a salary award from the Fonds de recherche du Québec – Santé (366934), with additional support through a Research Centre Grant to Douglas Research Centre (5230).


License

MIT License -- Copyright (c) 2026 Rukun Dou, Tiana Wei, Alban Elias Voppel, Lena Palaniyappan

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

psychiatrynlpkit-0.1.7.tar.gz (11.4 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

psychiatrynlpkit-0.1.7-py3-none-any.whl (11.4 MB view details)

Uploaded Python 3

File details

Details for the file psychiatrynlpkit-0.1.7.tar.gz.

File metadata

  • Download URL: psychiatrynlpkit-0.1.7.tar.gz
  • Upload date:
  • Size: 11.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for psychiatrynlpkit-0.1.7.tar.gz
Algorithm Hash digest
SHA256 49375ea1cf1225f3441e67795edb390e117cee7e75af38a3ae620091a38bc361
MD5 079bced40aaa842ba248cb1d00291ca7
BLAKE2b-256 d036e6f1ed19e107ed1241f9eeda6701fddb7f84e51fc698a3d95f26ccf61d99

See more details on using hashes here.

Provenance

The following attestation bundles were made for psychiatrynlpkit-0.1.7.tar.gz:

Publisher: publish.yml on rukun-dou/PsychiatryNLPKit

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file psychiatrynlpkit-0.1.7-py3-none-any.whl.

File metadata

File hashes

Hashes for psychiatrynlpkit-0.1.7-py3-none-any.whl
Algorithm Hash digest
SHA256 1f18d6796c03eee109ad054f866310b6745710d4c695f8480c350e9f7352ea71
MD5 5a95fde038d8d0514428b205b40efb9d
BLAKE2b-256 733f7551bca229ffce3aa5139dbf0edafa29904225c23f8e958b15058e0478c0

See more details on using hashes here.

Provenance

The following attestation bundles were made for psychiatrynlpkit-0.1.7-py3-none-any.whl:

Publisher: publish.yml on rukun-dou/PsychiatryNLPKit

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.1.7 This release

2 files

0.1.6

2 files

0.1.5

2 files

0.1.4

2 files

0.1.3

2 files

0.1.2

2 files

0.1.1

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page