browndw commited on
Commit
a4b5cd2
1 Parent(s): 954b148

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +23 -0
app.py ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import streamlit as st
2
+ import spacy
3
+ from spacytextblob.spacytextblob import SpacyTextBlob
4
+ from spacy_streamlit import visualize_ner
5
+
6
+ st.header("DocuScope Demo")
7
+ st.markdown("This demo uses Spacy to identify entities in text.")
8
+ st.markdown("NOTE: this demo is public - please don't enter confidential text")
9
+
10
+ # Streamlit text boxes
11
+ # Text source: https://www.theguardian.com/film/2016/dec/22/jaws-steven-spielberg-1975-review-derek-malcolm
12
+ text = st.text_area('Enter text:', value="Jaws is a splendidly shrewd cinematic equation which not only gives you one or two very nasty turns when you least expect them but, possibly more important, knows when to make you think another is coming without actually providing it.")
13
+
14
+
15
+ nlp = spacy.load("en_docusco_spacy")
16
+ if text:
17
+ doc = nlp(text)
18
+ visualize_ner(doc, labels=nlp.get_pipe("ner").labels)
19
+
20
+
21
+ st.header("Label Explanation")
22
+ st.markdown("**Academic Terms:** Abstract, rare, specialized, or disciplinary-specific terms that are indicative of informationally dense writing")
23
+ st.markdown("**Academic Writing Moves:** Phrases and terms that indicate academic writing moves, which are common in research genres and are derived from the work of Swales (1981) and Cotos et al. (2015, 2017)")