Skip to main content

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


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 details)

Uploaded Source

Built Distribution

nlp_tools_py_lib-0.1.1-py3-none-any.whl (7.3 kB view details)

Uploaded Python 3

File details

Details for the file nlp-tools-py-lib-0.1.1.tar.gz.

File metadata

  • Download URL: nlp-tools-py-lib-0.1.1.tar.gz
  • Upload date:
  • Size: 5.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.2 CPython/3.7.6 Windows/10

File hashes

Hashes for nlp-tools-py-lib-0.1.1.tar.gz
Algorithm Hash digest
SHA256 3b7a3fe778b30356e6643d8da0fe95a7341e9a6d08fb24941629c069477ea7f3
MD5 ffda33f99e22ab542ef0b039a8e72489
BLAKE2b-256 e72469aef2d5f343a0cc8cf6e1b055ddeb2ae8ec020cec485230f256c4d10f03

See more details on using hashes here.

File details

Details for the file nlp_tools_py_lib-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for nlp_tools_py_lib-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 20aaa199554a44ed2367e2cb7e0a7f5f3cd3372e7062b1a102768bcadb4b66ee
MD5 9a58765d3eabe1fe014d4ee89325b8ac
BLAKE2b-256 6663f6cbe97e667c289c29ba82b3a51f5efcc0b216b9bebd55c86113a59e2085

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page