Skip to main content

A fuzzy classifier for natural language text

Project description

FTC - Fuzzy Text Classifier

A fuzzy classifier library for natural language text. Github-Repo

Simple usage example

#import library
from fuzzy_text_classifier import TextClassifier  

#instantiate class
tc = TextClassifier()

#train the classifier with some documents
doc1 = 'some text document about sport'
doc2 = 'another text document about cinema'
doc3 = 'another one text document music'

tc.train(doc1, 'sport')
tc.train(doc2, 'cinema')
tc.train(doc3, 'music')

#classify a document
doc = 'a document about sport to classify'
ranking = tc.classify(doc)

ranking will be an object like

[{'sport': 1.0}, {'cinema': 0.6666666666666666}, {'music': 0.3333333333333333}]

a list ordered by similarity where the key is the category and the value is the degree of similarity between the document and the category.

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

fuzzy-text-classifier-1.0.2.tar.gz (2.8 kB view hashes)

Uploaded Source

Built Distribution

fuzzy_text_classifier-1.0.2-py3-none-any.whl (5.2 kB view hashes)

Uploaded Python 3

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