How to identify Spanish vs. English Text from a csv of tweets?
I think there are two ways.
i) to train a model to determine the text is Spanish or English using
(NLP).
ii) just trow the sentences to a list and use if condition with
Spanish Character to give 1 or 0 on the bases of conditions.
Hope it is helpful.
I'm trying to create a column that identifies English and Spanish tweets from a dataframe with several rows of tweets. Ideally tweets in English would be categorized as a 1 and those in Spanish would be marked as 0.
The end goal is to be able to filter out Spanish tweets from my dataframe to save English tweets in a new CSV. I looked at using Textblob, langdetect, and also fastText, but everything I've found gives instructions for just running the code on 1 string of text at a time.
Is there an easy way to categorize by language (English/Spanish) for a whole dataframe using Python?