Skip to content

Improving model#18

Open
AmarskiyArtem wants to merge 4 commits intoSimulatorML:mainfrom
AmarskiyArtem:improving-model
Open

Improving model#18
AmarskiyArtem wants to merge 4 commits intoSimulatorML:mainfrom
AmarskiyArtem:improving-model

Conversation

@AmarskiyArtem
Copy link
Copy Markdown

No description provided.

logger.info("Predicting...")
pred_scores = []
name_features = ""
name_features = []
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Изменил, так как раньше возвращалась общая строка для всего датасета

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

О, спасибо

total_score += temp_score
name_features += temp_name_features
total_score_normalized = self._normalize_score(total_score, threshold=1)
if len(X.iloc[0, :]["text"].split()) < 2 and all(
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

мне кажется если хочешь не штрафовать за короткие сообщения, то просто убери правило _len_msg

Такие костыли усложняют код и не логичные

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Сделал так, потому короткие сообщения тоже могут быть спамовыми, e.g тг-линк + картинка. Или сообщения из одного стоп-ворда. Однако в основном короткие сообщения это ок и штрафовать их не нужно. Ориентировался на треин/тест/некоторые собранные примеры. Так убирались некоторые FP, однако явный спам все еще блокировался (не рос FN). Просто убирать правило коротких сообщений не приносит профита.

logger.info("Predicting...")
pred_scores = []
name_features = ""
name_features = []
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

О, спасибо

total_score += temp_score
name_features += temp_name_features
total_score_normalized = self._normalize_score(total_score, threshold=1)
if len(message["text"].split()) < 2 and all(
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ну тут опять так же

на какого рода сообщений это нацелено? прям конкретно усложняет код, а цели я особо не вижу пока


return score, feature

def _check_len_message(self, message):
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

из модели для валидации удалил правило, а в prod оставил

уже тогда и из продовой удалить это правило

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants