Skip to content

Commit

Permalink
refactor(keyword_trend.py): refine keyword topic definitions
Browse files Browse the repository at this point in the history
  • Loading branch information
davidpomerenke committed Jul 21, 2024
1 parent 589a885 commit b6222ec
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 15 deletions.
12 changes: 8 additions & 4 deletions backend-python/media_impact_monitor/issue_keywords.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,18 @@ activism:
- mahnwache
- hungerstreik
- ziviler ungehorsam
climate_science:
climate_general:
- klimawandel
- klimaerwärmung
- erderwärmung
- klimaschutz
- klimagerechtigkeit
- klimapolitik
- klimaneutral*
climate_science:
- klimaforsch*
- klimawissenschaft*
- erderwärmung
- ipcc
climate_policy:
- klimapoliti*
- klimaneutral*
- klimaziel*
- klimaschutzpaket
Expand All @@ -41,6 +44,7 @@ climate_policy:
- neun-euro-ticket
- vergesellschaftung
- schuldenschnitt
- klimagerechtigkeit
climate_urgency:
- klimakrise
- klimakatastrophe
Expand Down
22 changes: 11 additions & 11 deletions backend-python/media_impact_monitor/trends/keyword_trend.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,19 +56,19 @@ def load_keywords():
def topic_queries(media_source: str) -> dict[str, str]:
keywords = load_keywords()
keyword_queries = {
"science": xs(keywords["climate_science"], media_source),
"policy": xs(keywords["climate_policy"], media_source),
"urgency": xs(keywords["climate_urgency"], media_source),
"all_excl_activism": xs_without_ys(
keywords["climate_science"]
+ keywords["climate_policy"]
+ keywords["climate_urgency"],
keywords["activism"],
media_source,
),
"climate policy": xs(keywords["climate_policy"], media_source),
"climate science": xs(keywords["climate_science"], media_source),
"climate crisis framing": xs(keywords["climate_urgency"], media_source),
# "all_excl_activism": xs_without_ys(
# keywords["climate_science"]
# + keywords["climate_policy"]
# + keywords["climate_urgency"],
# keywords["activism"],
# media_source,
# ),
}
if media_source != "web_google":
keyword_queries["activism"] = xs_with_ys(
keyword_queries["climate activism"] = xs_with_ys(
keywords["climate_science"]
+ keywords["climate_policy"]
+ keywords["climate_urgency"],
Expand Down

0 comments on commit b6222ec

Please sign in to comment.