Skip to content

Commit eb7c40b

Browse files
authored
Merge pull request #450 from dataforgoodfr/fix-country-keywords-update
fix country filtering on keywords
2 parents 91b0f3c + e71bb71 commit eb7c40b

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

quotaclimat/data_processing/mediatree/detect_keywords.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ def get_themes_keywords_duration(plaintext: str, subtitle_duration: List[str], s
199199
plaitext_without_stopwords = remove_stopwords(plaintext=plaintext, stopwords=stop_words, country=country)
200200
logging.debug(f"display datetime start {start}")
201201

202-
logging.debug(f"Keeping only {country.language} keywords...")
202+
logging.info(f"Keeping only {country.language} keywords...")
203203
try:
204204
for theme, keywords_dict in THEME_KEYWORDS.items():
205205
logging.debug(f"searching {theme} for {keywords_dict}")

quotaclimat/data_processing/mediatree/update_pg_keywords.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@ def update_keywords(session: Session, batch_size: int = 50000, start_date : str
7171
stop_word_keyword_only = False, \
7272
biodiversity_only = False,
7373
country=FRANCE) -> list:
74+
75+
logging.info(f"Updating keywords for Country : {country.name}")
7476

7577
filter_days_stop_word = int(os.environ.get("FILTER_DAYS_STOP_WORD", 30))
7678
logging.info(f"FILTER_DAYS_STOP_WORD is used to get only last {filter_days_stop_word} days of new stop words - to improve update speed")
@@ -135,7 +137,7 @@ def update_keywords(session: Session, batch_size: int = 50000, start_date : str
135137
,number_of_biodiversite_causes_no_hrfp \
136138
,number_of_biodiversite_consequences_no_hrfp \
137139
,number_of_biodiversite_solutions_no_hrfp \
138-
,country_name = get_themes_keywords_duration(plaintext, srt, start, stop_words=stop_words)
140+
,country_name = get_themes_keywords_duration(plaintext, srt, start, stop_words=stop_words, country=country)
139141

140142

141143
if(number_of_keywords != new_number_of_keywords or

0 commit comments

Comments
 (0)