Я получаю эту ошибку пакета: «Модуль «texthero.preprocessing» не имеет атрибута «remove_stopwords».Python

Программы на Python
Anonymous
Я получаю эту ошибку пакета: «Модуль «texthero.preprocessing» не имеет атрибута «remove_stopwords».

Сообщение Anonymous »

У меня были проблемы с моим предыдущим компьютером, поэтому мне пришлось сменить его и взять другой компьютер, но на новом я получил эту ошибку с этим кодом. Я не понимаю почему, ведь на моем предыдущем компьютере все работало нормально.
Вот мой код:

Код: Выделить всё

from texthero import preprocessing

custom_pipeline = [preprocessing.fillna # Remplacez les valeurs non affectées par des espaces vides
, preprocessing.lowercase # transforme tout le texte en minuscules
, preprocessing.remove_digits # Supprimez tous les blocs de chiffres
, preprocessing.remove_punctuation # supprimez tous les string.punctuation (! "# $% & '() * +, -. / :; ? @ [\] ^ _` {|} ~)
, preprocessing.remove_diacritics # Supprimez tous les accents des chaînes
, preprocessing.remove_stopwords # Supprimez tous les mots vides
, preprocessing.remove_whitespace # Supprimez tout espace blanc entre les mots
, preprocessing.remove_html_tags # supprimer toutes les balises HTML d’une chaîne
, preprocessing.remove_brackets] # supprimer les crochets de la chaîne
# custom_pipeline à l'argument pipeline
df_biens_cons_variable_pertinentes['clean_description'] = hero.clean(df_biens_cons_variable_pertinentes['description'], pipeline = custom_pipeline)
df_biens_cons_variable_pertinentes['clean_product_name'] = hero.clean(df_biens_cons_variable_pertinentes['product_name'], pipeline = custom_pipeline)

display(df_biens_cons_variable_pertinentes.head(2))

index = 1000

text=df_biens_cons_variable_pertinentes.description[index]
print('#text brut #:',text)
text_clean =df_biens_cons_variable_pertinentes['clean_description'][index]
print('#text_clean# :',text_clean)
И вот ошибка: AttributeError: модуль «texthero.preprocessing» не имеет атрибута «remove_stopwords»
Он также имел ошибку for preprocessing.remove_html_tags
Я искал в Интернете, и кажется, что никто не сталкивался с такими проблемами с texthero, так что я немного растерялся. Есть ли у вас идеи, почему это происходит?
У меня есть еще один вопрос: почему texthero не отображается в разделе тегов stackoverflow?

Подробнее здесь: https://stackoverflow.com/questions/787 ... tribute-re

Вернуться в «Python»