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
e985c022
Commit
e985c022
authored
3 years ago
by
vvye
Browse files
Options
Downloads
Patches
Plain Diff
Fix issue
parent
7f168ea7
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
run.py
+4
-0
4 additions, 0 deletions
run.py
summarization.py
+2
-1
2 additions, 1 deletion
summarization.py
with
6 additions
and
1 deletion
run.py
+
4
−
0
View file @
e985c022
...
...
@@ -30,6 +30,10 @@ def main(args):
timeline
=
timeline_generation
.
make_timeline
(
articles
,
gold_timeline
,
keywords
,
by_tokens
)
if
not
timeline
:
print
(
'
the generated timeline is empty - skipping evaluation of this one
'
)
continue
if
args
.
print_timelines
:
timeline_generation
.
print_timeline
(
timeline
)
...
...
This diff is collapsed.
Click to expand it.
summarization.py
+
2
−
1
View file @
e985c022
...
...
@@ -47,6 +47,7 @@ def summarize(sentences, vectorizer, keywords, by_tokens, num_sentences, num_tok
# go through all sentences in order from "best" (most similar to centroid) to "worst"
for
i
in
sorted_indices
:
# don't consider this sentence in the next round
remaining_indices
.
remove
(
i
)
# if the sentence contains no keywords, skip it
...
...
@@ -60,7 +61,7 @@ def summarize(sentences, vectorizer, keywords, by_tokens, num_sentences, num_tok
if
sum
([
len
(
sentences
[
k
][
'
text
'
].
split
())
for
k
in
(
selected_indices
+
[
i
])])
>
round
(
num_tokens
):
continue
else
:
if
len
(
selected_indices
)
+
2
>
round
(
num_sentences
):
if
len
(
selected_indices
)
+
1
>
round
(
num_sentences
):
continue
# otherwise, select the sentence
selected_indices
.
append
(
i
)
...
...
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