Registry / ai-ml / pyvi
library0.1.1pypypi✓ verified 87d ago

PyVi is a Python toolkit for Vietnamese language processing, providing tokenization (word segmentation), part-of-speech tagging, and named entity recognition. Currently at version 0.1.1, the project appears to be in maintenance mode with no recent updates.

pip install pyvi
INSTALL
IMPORT
SIG · PYVI
P
pyvi
ai-mlpythonv0.1.1
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.

Tokenizer
from pyvi import ViTokenizer
from pyvi import tokenize
Wrong import; correct class is ViTokenizer.
POSTagger
from pyvi import ViPOSTagger
from pyvi import pos_tag
Wrong import; correct class is ViPOSTagger.

Tokenize Vietnamese text and perform POS tagging.

from pyvi import ViTokenizer, ViPosTagger text = 'Học sinh học sinh học' tokens = ViTokenizer.tokenize(text) print(tokens) # Output: Học_sinh học_sinh học # POS tagging words = tokens.split() tags = ViPosTagger.postagging(words) print(tags) # Output: (['Học_sinh', 'học_sinh', 'học'], ['N', 'N', 'V'])
Debug
Known issues
gotchaThe tokenizer combines syllables with underscores (e.g., 'Học_sinh'). Do not split on spaces before feeding to downstream tasks without handling underscores.
fix
Use tokenizer output directly or replace underscores with spaces as needed.
affects: all versions
deprecatedThe package has not been updated since 2020. Models may be outdated compared to newer approaches.
fix
Consider alternatives like underthesea or VnCoreNLP for better accuracy.
affects: 0.1.1
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'pyvi'
PyVi is not installed.
fix
Run: pip install pyvi
AttributeError: module 'pyvi' has no attribute 'ViTokenizer'
Incorrect import statement.
fix
Use: from pyvi import ViTokenizer
FileNotFoundError: [Errno 2] No such file or directory: 'pyvi/ViTokenizer/data/tokenized_data.pkl'
Package data files missing; likely a broken installation.
fix
Reinstall pyvi: pip install --force-reinstall pyvi
Upgrade
Version history
0.1.1latest on PyPI · released Jun 30, 2021
Audit
Dependencies

No dependency data recorded yet.

Agent activity
15 hits · last 30 days
node
14
OpenAI (training)
1
Resources
pyvi — pip install pyvi · libregistry