реализована функция clear_text
This commit is contained in:
parent
3f3b3fc630
commit
8ae04ec651
6
data.csv
6
data.csv
@ -1,3 +1,3 @@
|
||||
1;5;good job
|
||||
2;5;nice price
|
||||
3;5;super work
|
||||
1;5;gOOd Job
|
||||
2;5;niCe pRIcE
|
||||
3;5;sUPer worKk
|
||||
|
15
main.py
15
main.py
@ -1,8 +1,19 @@
|
||||
# Система анализа и модерации отзывов на товары (E-Commerce Review Engine)
|
||||
|
||||
def clean_text(text: str):
|
||||
|
||||
return str
|
||||
text = "1;5;?П:::р?И,,вЕт! ДуРг."
|
||||
black_list = ",?:"
|
||||
if text[3] == ';':
|
||||
start_text = text[:5]
|
||||
text = text[4:]
|
||||
for i in range(len(black_list)):
|
||||
text = text.replace(black_list[i], '')
|
||||
text = text.lower()
|
||||
for i in range(len(text)):
|
||||
text = text.replace(' ', ' ')
|
||||
return text
|
||||
else:
|
||||
print("Некорректный ввод текста отзыва")
|
||||
|
||||
|
||||
def extract_keywords(text: str, keywords_dict: dict):
|
||||
|
||||
Loading…
Reference in New Issue
Block a user