added functions to clean content
This commit is contained in:
@@ -0,0 +1,9 @@
|
|||||||
|
from cleantext import clean
|
||||||
|
|
||||||
|
def clean_content(text):
|
||||||
|
return clean(text, to_ascii=False)
|
||||||
|
|
||||||
|
def clean_content_df(df):
|
||||||
|
content_clean = df['content'].apply(clean_content).to_list()
|
||||||
|
id_list = df['id'].to_list()
|
||||||
|
return content_clean, id_list
|
||||||
Reference in New Issue
Block a user