Python Fast text Text Classification

336 views Asked by At

I am attempting to classify how "good" short work reports are using fast text text classification. At this stage I made only one label "interfering behavior" which I' calling __label__int, because I just want to see if it will work. I want to compare texts with how closely they match sentences taken from good reports. I made my own training text document - a sample of which is:

__label__int Aggression data are low and stable at occurrences.
__label__int Elopement frequency has decreased to occurrences.
__label__int Property destruction data are low and stable at occurrences.
__label__int Non-compliance frequency is stagnant at occurrences.
__label__int Tantrum duration is low and stable at minutes.
__label__int Aggression frequency is on an increasing trend.
__label__int Crying percentage is on a decreasing trend.
__label__int Elopement frequency is on a decreasing trend.

and my code I have written is:

import fasttext

model = fasttext.train_supervised(input = 'Interfering Behavior Train.txt')
model.save_model("model_int-behavior.bin")

print_results(*model.test("test_valid.txt"))

but I keep getting the following output:

Read 0M words Number of words: 94 Number of labels: 1 N 0 P@1 nan R@1 nan Progress: 100.0% words/sec/thread: 12881 lr: 0.000000 avg.loss: 0.000000 ETA: 0h 0m 0s

text_valid.txt is one of the files I know has these terms in it, so im expecting a good comparison. I could not find anything online about how to write the custom labeled data sets. Is there an issue with maybe my training data? too many words? Or is my code incomplete?

0

There are 0 answers