Skip to content

Commit

Permalink
refactor(sentiment trend): adjust sampling fractions
Browse files Browse the repository at this point in the history
  • Loading branch information
davidpomerenke committed Aug 7, 2024
1 parent 7d8b6b0 commit 52c469d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion backend-python/media_impact_monitor/fulltexts.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@


@cache
def get_fulltexts(q: FulltextSearch, sample_frac: float = 0.01) -> pd.DataFrame | None:
def get_fulltexts(q: FulltextSearch, sample_frac: float = 0.1) -> pd.DataFrame | None:
keywords = load_keywords()
queries = []
if q.topic:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def get_sentiment_trend(q: TrendSearch) -> pd.DataFrame | str:
params = dict(q)
del params["trend_type"]
del params["aggregation"]
fulltexts = get_fulltexts(FulltextSearch(**params))
fulltexts = get_fulltexts(FulltextSearch(**params), sample_frac=0.01)

# aggregate positive, neutral, negative sentiments by day
df = fulltexts.groupby("date")[field].agg(
Expand Down

0 comments on commit 52c469d

Please sign in to comment.