debug
Browse files
app.py
CHANGED
@@ -8,7 +8,6 @@ from transformers import pipeline, T5Tokenizer
|
|
8 |
from extractive_summarizer.model_processors import Summarizer
|
9 |
from src.utils import clean_text, fetch_article_text
|
10 |
from src.abstractive_summarizer import (
|
11 |
-
abstractive_summarizer,
|
12 |
preprocess_text_for_abstractive_summarization,
|
13 |
)
|
14 |
|
@@ -76,12 +75,12 @@ if __name__ == "__main__":
|
|
76 |
abs_summarizer = pipeline(
|
77 |
"summarization", model=abs_model_name, tokenizer=abs_tokenizer_name
|
78 |
)
|
79 |
-
if
|
80 |
# list of chunks
|
81 |
text_to_summarize = preprocess_text_for_abstractive_summarization(
|
82 |
tokenizer=abs_tokenizer, text=clean_txt
|
83 |
)
|
84 |
-
|
85 |
tmp_sum = abs_summarizer(text_to_summarize, do_sample=False)
|
86 |
|
87 |
summarized_text = " ".join([summ["summary_text"] for summ in tmp_sum])
|
|
|
8 |
from extractive_summarizer.model_processors import Summarizer
|
9 |
from src.utils import clean_text, fetch_article_text
|
10 |
from src.abstractive_summarizer import (
|
|
|
11 |
preprocess_text_for_abstractive_summarization,
|
12 |
)
|
13 |
|
|
|
75 |
abs_summarizer = pipeline(
|
76 |
"summarization", model=abs_model_name, tokenizer=abs_tokenizer_name
|
77 |
)
|
78 |
+
if is_url is False:
|
79 |
# list of chunks
|
80 |
text_to_summarize = preprocess_text_for_abstractive_summarization(
|
81 |
tokenizer=abs_tokenizer, text=clean_txt
|
82 |
)
|
83 |
+
print(text_to_summarize)
|
84 |
tmp_sum = abs_summarizer(text_to_summarize, do_sample=False)
|
85 |
|
86 |
summarized_text = " ".join([summ["summary_text"] for summ in tmp_sum])
|