simple nlp library
Project description
nlp-tools-py-lib
python simple nlp library
installation
pip install nlp-tools-py-lib
usage
# main.py
from nlp_tools.preprocessing import Preprocessing
from nlp_tools.loaders import MdLoader
from nlp_tools.representations import MergedMatrixRepresentation
from nlp_tools.classifiers import ClassificationProcessor, NaiveBayseTfIdfClassifier
TRAIN_PATH = 'demo_training.md'
def build_classifier():
loader = MdLoader(TRAIN_PATH)
processor = Preprocessing(loader)
repres = MergedMatrixRepresentation(processor.data)
classifier = ClassificationProcessor(NaiveBayseTfIdfClassifier(), repres)
classifier.train()
def predict(text: str):
message = repres.process_new_data(processor.process_sentence(text))
intent, score = classifier.predict(message)
return intent, score
return predict
training.md
example :
# intents
## my_first_intent_name
### responses
- ...
### example
- ...
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
nlp-tools-py-lib-0.1.1.tar.gz
(5.9 kB
view hashes)
Built Distribution
Close
Hashes for nlp_tools_py_lib-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 20aaa199554a44ed2367e2cb7e0a7f5f3cd3372e7062b1a102768bcadb4b66ee |
|
MD5 | 9a58765d3eabe1fe014d4ee89325b8ac |
|
BLAKE2b-256 | 6663f6cbe97e667c289c29ba82b3a51f5efcc0b216b9bebd55c86113a59e2085 |