Skip to content

Commit

Permalink
Add item for code_commune_insee label detection
Browse files Browse the repository at this point in the history
  • Loading branch information
geoffreyaldebert committed Feb 11, 2022
1 parent 2f9ffc7 commit 7c9c918
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
def _is(header):
'''Returns 1 if the (processed) header matches one of the expected words combination, else 0'''

words_combinations_list = ['code commune insee', 'code insee', 'codes insee']
words_combinations_list = ['code commune insee', 'code insee', 'codes insee', 'code commune']
processed_header = _process_text(header)

header_matches_words_combination = float(any([words_combination == processed_header for words_combination in words_combinations_list]))
words_combination_in_header = 0.5*float(any([full_word_strictly_inside_string(words_combination, processed_header) for words_combination in words_combinations_list]))

return max(header_matches_words_combination, words_combination_in_header)
return max(header_matches_words_combination, words_combination_in_header)

0 comments on commit 7c9c918

Please sign in to comment.