googlyeyes commited on
Commit
f52ac06
1 Parent(s): f21ef5d

Added an application file. This file can read text and displays the keywords in the text

Browse files
Files changed (1) hide show
  1. app.py +18 -0
app.py ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import streamlit as st
2
+ import yake
3
+
4
+ st.title("Question answer generation")
5
+ st.markdown("The model outputs a set of questions and answers based on a paragraph")
6
+
7
+ # Text input widget
8
+ text = st.text_area(label="Enter text corpus here")
9
+
10
+ # For now we consider only single paragraphs of text
11
+ # paragraphs = parse_text(text) would break the text into multiple paragraphs
12
+
13
+ # Initialize the keyword extractor
14
+ kw_extractor = yake.KeywordExtractor()
15
+ keywords = kw_extractor.extract_keywords(text)
16
+
17
+ # Display the keywords that were extracted
18
+ st.write(keywords)