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 = './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.0.tar.gz
(5.8 kB
view hashes)
Built Distribution
Close
Hashes for nlp_tools_py_lib-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7c8d301707bbe9b49dd0997274f20a494f523ea5c4b93653d2f344ef1dfe7ae0 |
|
MD5 | 321a418bd5c8318c45906d7bf67ee070 |
|
BLAKE2b-256 | 58cca57e5d219dff8676e8ca8dd7762fdf048874ea2596f816707faf58a8da43 |