src.features
.translate_func
¶
-
src.features.
translate_func
( x , text , lang ) [source] ¶ -
Function to use the .apply method on all rows of a dataframe to translate text. Performs better then itterrow.
- Parameters
-
- x Series or dict
-
Pandas DataFrame row.
- text str
-
Name of the key containing the text to be translated.
- lang str
-
Name of the key containing the language of the text.
- Returns
-
- process str
-
Text translated into English.