facebookresearch / StarSpace

Learning embeddings for classification, retrieval and ranking.
MIT License
3.94k stars 531 forks source link

error load sample.txt #303

Closed yinrong closed 3 years ago

yinrong commented 3 years ago

with sample.txt:

dog:0.1 cat:0.5

the following error happends

starspace train -trainFile sample.txt -model docspace -useWeight 1 -trainMode 1 -fileFormat labelDoc
Start to initialize starspace model.
Build dict from input file : sample.txt
Read 0M words
Number of words in dictionary:  2
Number of labels in dictionary: 0
dogcatLoading data from file : sample.txt
Total number of examples loaded : 0
ERROR: File 'sample.txt' does not contain any valid example.
Please check: is the file empty? Do the examples contain proper feature and label according to the trainMode? If your examples are unlabeled, try to set trainMode=5.

exit-status: 1
yinrong commented 3 years ago

passed by change sample.txt to:

dog:0.1 cat:0.5<tab>dog:0.1 cat:0.5