| Files | Last commit | Last update |
|---|---|---|
| 6 months ago | ||
| 8 months ago |
How to Use the Python NLP Environment Plug-in
Plugin Description
This plug-in is used to automatically deploy the Python NLP virtual environment on openEuler. The following core libraries are included:
- spaCy: industrial-grade NLP library
- NLTK: natural language processing toolkit
- Gensim: topic modeling and document similarity library
- Transformers: pre-trained model library of Hugging Face
In addition, some common auxiliary libraries, such as NumPy, pandas, scikit-learn, matplotlib, Jupyter, and sentence-transformers, will be installed.
Supported Operations
install: installs the Python NLP environment.uninstall: uninstalls the Python NLP environment.status: checks the status of the Python NLP environment.
Configuration Description
Configure the following parameters in the config.yaml file.
| Parameter | Description | Default Value |
|---|---|---|
python_version |
Python version | 3.9 |
venv_name |
Virtual environment name | python-nlp-env |
venv_path |
Virtual environment path | /opt/python-nlp-env |
install_mode |
Installation mode (system/venv) | venv |
spacy_version |
spaCy version | latest |
nltk_version |
NLTK version | latest |
gensim_version |
Gensim version | latest |
transformers_version |
Transformers version | latest |
download_resources |
Whether to download NLP resources | true |
extra_packages |
Additional packages | numpy, pandas, scikit-learn, matplotlib, jupyter, ipython, seaborn, scipy, plotly, tqdm, Pillow, opencv-python, datasets, tokenizers, sentence-transformers, pyarrow, fasttext, textblob, wordcloud, pattern |
download_timeout |
Download timeout (s) | 600 |
download_retry |
Download retry attempts | 3 |
pip_mirror |
pip image source | https://pypi.tuna.tsinghua.edu.cn/simple |
Examples
Installing the Python NLP Environment
oedp run install
Checking the Status of the Python NLP Environment
oedp run status
Uninstalling the Python NLP Environment
oedp run uninstall
Precautions
- This plug-in requires the root permission.
- By default, the virtual environment is used for installation to avoid affecting the system Python.
- System dependencies are automatically installed during the installation.
- By default, NLP resources (such as the spaCy model and NLTK data packet) are downloaded.
- Customized NLP library versions are supported.
- The image source in China is used for high-speed download.
- This plug-in applies to openEuler 24.03-LTS and later versions.
Troubleshooting
- If the installation fails, check whether the network connection is normal.
- If the resources fail to be downloaded, check the network connection or set
download_resources: false. - If the dependency package fails to be installed, check the pip image source configuration.
- If the virtual environment fails to be created, check the directory permission.
- If the memory is insufficient, increase the system memory.
Version History
- v1.0.0: initial version, which supports the installation and management of the Python NLP environment.