Skip to main content
Python Software Foundation 20th Year Anniversary Fundraiser  Donate today!

Neural Network to classify short strings

Project description

Char Classifier
---------

Given a short phrase, train a neural network to classify it based on the characters that it contains.

The trainer takes in a file of phrases (separated by new line) and a file of target values (separated by new line).

To train on the sample data (parts of speech classification):

```
from phrase_classifier import PhraseClassificationTrainer, PhraseClassifier
p = PhraseClassificationTrainer("sample/words", "sample/parts-of-speech")
p.train([100, 100], 20, 100)
p.save("sample", "example-run")
```

This will save a trained model with the tag 'example-run' in the sample directory. To use that model, run:

```
k = PhraseClassifier("sample", "example-run")
print k.classify("dog")
```

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for char-classifer, version 0.6.0
Filename, size File type Python version Upload date Hashes
Filename, size char_classifer-0.6.0-py2.py3-none-any.whl (6.5 kB) File type Wheel Python version 2.7 Upload date Hashes View
Filename, size char-classifer-0.6.0.tar.gz (5.7 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page