Skip to content
Snippets Groups Projects
Commit 32eb4acb authored by vvye's avatar vvye
Browse files

Rename date selection function

parent 0c8fe16a
No related branches found
No related tags found
No related merge requests found
from collections import Counter
def select_dates_by_mention_count(articles, start_date, end_date):
def rank_dates_by_mention_count(articles, start_date, end_date):
mention_count = Counter({})
for article in articles:
for sentence in article['sentences']:
......
......@@ -23,7 +23,7 @@ def make_timeline(articles, gold_timeline, keywords):
# articles = dataset.filter_articles_by_keywords(articles, keywords)
# select dates
ranked_dates = date_selection.select_dates_by_mention_count(articles, start_date, end_date)
ranked_dates = date_selection.rank_dates_by_mention_count(articles, start_date, end_date)
# train TFIDF vectorizer on all sentences (not just the ones for this date)
all_sentences = [sentence['text'] for article in articles for sentence in article['sentences']]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment