-
Notifications
You must be signed in to change notification settings - Fork 0
Tf idf #13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Tf idf #13
Conversation
tfidf_1.py
Outdated
| for item in _tf_txt: | ||
| tf.append((item, _tf_txt[item] / len(text))) | ||
|
|
||
| if os.path.isfile('idf.json'): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
у тебя получается, что для каждого входного текста ты либо считаешь, либо загружаешь файл с idf - почему это не сделать один раз в конструкторе?
tfidf_1.py
Outdated
| sent.append(source.text) | ||
| for i in sent: | ||
| self._texts.append(re.sub(r'[^\w\s]', '', i.lower())) | ||
| if os.path.exists('idf_file'): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
а почему на существование проверяется файл с одним названием, а загружается информация из другого? это же должен быть всё один файл?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ой, это я опечаталась
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
должен быть 'idf_file.json' судя по коду ниже. но уже ладно, зачтено задание:)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
фух! спасибо)
No description provided.