Spaces:
Sleeping
Sleeping
Create app.py
Browse files
app.py
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import streamlit as st
|
| 2 |
+
import pandas as pd
|
| 3 |
+
import numpy as np
|
| 4 |
+
import torch
|
| 5 |
+
import transformers
|
| 6 |
+
|
| 7 |
+
# Use a pipeline as a high-level helper
|
| 8 |
+
from transformers import pipeline
|
| 9 |
+
|
| 10 |
+
pipe = pipeline("summarization", model="facebook/bart-large-xsum")
|
| 11 |
+
|
| 12 |
+
st.write('\n')
|
| 13 |
+
|
| 14 |
+
st.write('Enter Text for Summarization:')
|
| 15 |
+
|
| 16 |
+
text=st.text_input("")
|
| 17 |
+
|
| 18 |
+
if st.button("Submit"):
|
| 19 |
+
st.write(pipe(text))
|