Skip to content

Conversation

@andreygetmanov
Copy link
Collaborator

Automatic text detection now is more effective, accurate and robust.

  1. Every column which possibly contains text now is checked on the tf-idf vocabulary size. If this size is more than threshold, this column really contains useful text information.
  2. Columns with links (they don't contain useful information and sometimes lead to a FEDOT fail) are removed automatically.
  3. Additional unit tests and extended tests (based on AutoML benchmark) will be added too.

@codecov
Copy link

codecov bot commented Sep 21, 2022

Codecov Report

Merging #903 (86ae96f) into master (c5f050d) will decrease coverage by 0.08%.
The diff coverage is 86.95%.

@@            Coverage Diff             @@
##           master     #903      +/-   ##
==========================================
- Coverage   87.86%   87.77%   -0.09%     
==========================================
  Files         206      206              
  Lines       13786    13726      -60     
==========================================
- Hits        12113    12048      -65     
- Misses       1673     1678       +5     
Impacted Files Coverage Δ
fedot/core/pipelines/tuning/search_space.py 100.00% <ø> (ø)
...implementations/data_operations/text_pretrained.py 56.14% <42.85%> (-4.73%) ⬇️
fedot/core/data/data_detection.py 96.70% <97.22%> (+1.31%) ⬆️
fedot/core/composer/metrics.py 97.22% <100.00%> (-0.04%) ⬇️
fedot/core/constants.py 100.00% <100.00%> (ø)
fedot/core/data/data.py 86.77% <100.00%> (-0.11%) ⬇️
fedot/core/data/multi_modal.py 87.62% <100.00%> (+2.05%) ⬆️
fedot/preprocessing/data_types.py 94.25% <100.00%> (+0.03%) ⬆️
...edot/core/repository/graph_operation_repository.py 66.66% <0.00%> (-8.34%) ⬇️
fedot/explainability/explainer_template.py 75.00% <0.00%> (-5.00%) ⬇️
... and 59 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

tfidf_vectorizer.fit(np.where(pd.isna(column), '', column))
if len(tfidf_vectorizer.vocabulary_) > MIN_VOCABULARY_SIZE:
return True
except ValueError:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Можем ли вынести из-под try лишние действия и сделать

# Полезные действия
try:
    # Полезные действия, где ловим ошибки
except:
    # Обработка
else: 
    # Полезные действия

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Можем ли вынести из-под try лишние действия и сделать

Вот так, например?

return False

@staticmethod
def is_link(text_data: np.array) -> bool:
Copy link
Collaborator

@Dreamlone Dreamlone Oct 1, 2022

Choose a reason for hiding this comment

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

Во первых, стоит написать тесты, покрывающие эту функциональность, но как я понял из описания PR - они и так в процессе

Во вторых, в описании к PR сказано, что "Columns with links (they don't contain useful information and sometimes lead to a FEDOT fail) are removed automatically". Отсюда возникает вопрос, а стоит ли привязываться именно к ссылкам и заносить их все в категорию "столбцов для удаления" (кстати, а не сбивается ли индексация столбцов после их удаления в supplementary data?)? То есть вполне себе могу представить кейс, когда количество уникальных значений в текстовом столбце будет равно двум и оба варианта будут ссылками например. Тогда после One Hot Encoding'а информация из этого столбца вполне может пригодиться. Поэтому имеет смысл выделить свойства столбца с гиперссылками, которые мешают ML алгоритмам и избавляться от всех столбцов с такими свойствами.

Например, если проблема в том, что ссылка всегда одинаковая, то тогда стоит просто удалять все столбцы с неизменным набором символов в ячейках безотносительно их содержания. Если же ссылки для кажого объекта уникальные, то может имеет смысл удалять все столбцы, в которых текст уникален и при этом не представляет собой сырье для NLP алгоритмов (например, нет осмысленных фраз в ячейках или пробелов). Или проблема именно с тем, что встречается набор символов http в ячейке?

С уже оставленными к этому PR комментариями согласен

@andreygetmanov andreygetmanov force-pushed the multimodal_text_detection branch from 87a289a to 178110d Compare October 6, 2022 13:03
@andreygetmanov andreygetmanov force-pushed the multimodal_text_detection branch from a7e5390 to c0ed0d7 Compare December 19, 2022 13:43
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.

5 participants