Skip to content
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

AttributeError: 'float' object has no attribute 'split' #34

Closed
sriprad opened this issue May 21, 2021 · 4 comments
Closed

AttributeError: 'float' object has no attribute 'split' #34

sriprad opened this issue May 21, 2021 · 4 comments

Comments

@sriprad
Copy link

sriprad commented May 21, 2021

Hi Team,
I have a question. I am trying to translate a column which has blanks in between. I am using EasyMT and its giving an error. won't it work if there is a blanks or missing in between the rows of a column?

Thanks
Srinivas

@nreimers
Copy link
Member

Hi @sriprad
You must make sure that all elements in your column are strings. The error shows that some cells are of type float, which does not work.
So replace these cells with an empty string ''

@sriprad
Copy link
Author

sriprad commented May 21, 2021

Hi @nreimers ,
Thank you. But when i dtype it shows object.
image
Please let me know your thoughts

thanks

@nreimers
Copy link
Member

It is better you convert your pandas dataframe to a list of sentences (strings) and pass this to the translate method

@sriprad
Copy link
Author

sriprad commented May 21, 2021

df_samples['translated_text'] = model.translate(df_samples['Сообщение об ОС поступления'], source_lang='ru', target_lang='en')
this is what i am currently doing . Anything missing?

thanks

@sriprad sriprad closed this as completed May 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants