Registry / ai-ml / underthesea-core

underthesea-core

JSON →
library3.3.2pypypi✓ verified 81d ago

Core Python library for Vietnamese Natural Language Processing (NLP), providing tokenization, word segmentation, POS tagging, named entity recognition, sentiment analysis, and text classification. Current version 3.3.2 targets Python ≥3.10. Release cadence: irregular, with major updates every few months.

pip install underthesea-core
INSTALL
IMPORT
SIG · UNDERTHESEA-CORE
U
underthesea-core
ai-mlpythonv3.3.2
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

underthesea_core
import underthesea_core
import underthesea

Basic usage of underthesea core functions.

import underthesea # Word segmentation text = "Chào bạn, tôi là người Việt Nam." tokens = underthesea.word_tokenize(text) print(tokens) # POS tagging pos_tags = underthesea.pos_tag(text) print(pos_tags) # Named entity recognition entities = underthesea.ner(text) print(entities) # Sentiment analysis (placeholder: uses a simple model) sentiment = underthesea.sentiment(text) print(sentiment) # Text classification category = underthesea.classify("Công nghệ thông tin") print(category)
Debug
Known issues
breakingBreaking change in v3.0.0: The function `word_tokenize` no longer accepts `format` parameter. Use `word_tokenize(text, format='text')` is removed; only list output is supported.
fix
Remove `format` parameter from calls to `word_tokenize`.
affects: >=3.0.0
breakingBreaking change in v3.0.0: `pos_tag` returns a list of tuples instead of a string. Check downstream code expecting string output.
fix
Update code to process list of tuples returned by `pos_tag`.
affects: >=3.0.0
gotchaModels are automatically downloaded on first use. This may take time and requires internet. Offline usage requires manual model caching.
fix
Pre-download models using `underthesea.download_all()` when internet is available.
affects: all
deprecatedFunction `sentiment` uses an older, less accurate model. It is deprecated in favor of Hugging Face Transformers models.
fix
Use `from transformers import pipeline` and load a Vietnamese sentiment model instead.
affects: >=3.3.0
breakingIn v2.x, `classify` returned a string. In v3.x, it returns a dictionary with keys 'label' and 'score'. This breaks code expecting a string.
fix
Update code to access `classify(text)['label']` instead.
affects: >=3.0.0
Upgrade
Version history
3.3.2latest on PyPI · released May 24, 2026
Audit
Dependencies
numpyrequiredNumerical operations for model inference
transformersoptionalTransformer-based models for advanced NLP tasks (optional for some features)
Agent activity
19 hits · last 30 days
node
17
OpenAI (training)
1
Resources
underthesea-core — pip install underthesea-core · libregistry