-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
KeyError: 'text' #85
Comments
Your CSV seems to be tab separated and not comma separated. At the moment we don't support TSV, we are working on it right now. For the time being please use comma to separate your columns and escape them if they appear in your text as described here. |
@w4nderlust ah yeah you were right, that was the question here #66 If anyone else is having the same issue: When on macOS: sed -i "" $'s/,/ /g' /root/spam_dataset.csv
sed -i "" $'s/\t/,/g' /root/spam_dataset.csv (keep an eye to the while on linux sed -i "" $'s/,/ /g' /root/spam_dataset.csv
sed -i "s/\t/,/g" /root/spam_dataset.csv We should to replace every and if for some reason you have forget the header: sed -i '' -e '1i\'$'\n''label,text' /root/spam_dataset.csv |
That's a great suggestion, a good workaround until we implement a better solution for reading TSVs and other file formats. |
I have the same problem and my data is separated using a comma and it still showing the same error :( |
@aminaBm are you sure that you do not have any additional |
I have the same issue as @aminaBm. I used df = pd.read_csv('dump_20190401.csv', escapechar='\') t try to deal with it but somehow it still is an issue for me. I get this error for this code: Code: Error:
|
I'm sorry @aminaBm an @cuggla91 . Those errors are pandas errors that reflect a probably malformed csv. Unfortunately if you can't share your data there isn't much I can do about it. Try cleaning up your csv and / or changing the separator up to the point where you have a readable csv, and then let me know what parameters of the |
I also have same problem. But I load the text data through manually using Dataframe. Then how can I separate the csv file from comma to tab.? |
|
im also getting same error
|
Hello,
my train csv file looks like
mbploreto:script loretoparisi$ head -n2 /root/spam_dataset.csv label text HAM waiting waiting waiting waiting solitude stands by the window as someone said i tried hard to find you i found fake promises instead the thought behind to join the thought before i thought i was blind sometimes i feel i feel the way to live i thought i had strength to overcome these walls i thought i was wonderful memories keep together things now would you like to know how it feels to be always stuck in the past without any rest the thought behind to join the thought before i thought i was blind SPAM please every body click cross
so I have my configuration as string
"{input_features: [{name: text, type: text}], output_features: [{name: label, type: category}]}"
and I start training then:
ludwig train --data_csv /root/spam_dataset.csv --model_definition "{input_features: [{name: text, type: text}], output_features: [{name: label, type: category}]}"
Suddenly I get that error about the
text
field:The text was updated successfully, but these errors were encountered: