Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
BA Timeline Summarization
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
kaiser
BA Timeline Summarization
Commits
32eb4acb
Commit
32eb4acb
authored
3 years ago
by
vvye
Browse files
Options
Downloads
Patches
Plain Diff
Rename date selection function
parent
0c8fe16a
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
date_selection.py
+1
-1
1 addition, 1 deletion
date_selection.py
timeline_generation.py
+1
-1
1 addition, 1 deletion
timeline_generation.py
with
2 additions
and
2 deletions
date_selection.py
+
1
−
1
View file @
32eb4acb
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
'
]:
...
...
This diff is collapsed.
Click to expand it.
timeline_generation.py
+
1
−
1
View file @
32eb4acb
...
...
@@ -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
'
]]
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment