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")
```
---------
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.
Source Distribution
chClassifier-0.6.2.tar.gz
(5.7 kB
view hashes)
Built Distribution
Close
Hashes for chClassifier-0.6.2-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6d0d1728b7dd0c2ecf84224e0e80fc6b52e7af4d28f5a765b491632dbf0cf655 |
|
MD5 | 69feb22f00192648a6b61e7be033a3f5 |
|
BLAKE2b-256 | 14cb705de16ccc8a83aad26391cc0aee9cb0a7d6c4edde6704501230c014f5e2 |