Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
Crisis Events Text 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
Francesco Crisafulli
Crisis Events Text Summarization
Commits
c4799bad
Commit
c4799bad
authored
11 months ago
by
anikets
Browse files
Options
Downloads
Patches
Plain Diff
Moved BERT summarizer to proper directory
parent
e0c73893
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
text_summarizers/text_summarizer.py
+25
-0
25 additions, 0 deletions
text_summarizers/text_summarizer.py
with
25 additions
and
0 deletions
text_summarizers/text_summarizer.py
0 → 100644
+
25
−
0
View file @
c4799bad
from
summarizer
import
Summarizer
import
requests
as
r
from
bs4
import
BeautifulSoup
from
flask
import
Flask
,
jsonify
,
request
app
=
Flask
(
__name__
)
@app.route
(
'
/BERT_summarize
'
,
methods
=
[
'
POST
'
])
def
summarize
():
#(text)
try
:
model
=
Summarizer
()
data
=
request
.
json
summary
=
model
(
data
[
'
text
'
])
return
jsonify
({
'
summary
'
:
summary
}),
200
except
Exception
as
e
:
return
jsonify
({
'
error
'
:
str
(
e
)}),
400
if
__name__
==
'
__main__
'
:
app
.
run
(
debug
=
True
)
# HOW TO RUN:
# Run this python file in your terminal
# Open the post_cli_tool2.py file and modify the url string to be 'http://127.0.0.1:5000/BERT_summarize'
# In a different terminal, run python post_cli_tool2.py
\ No newline at end of file
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