Spaces:
Running
Running
Commit
·
d5d351e
1
Parent(s):
61d316d
Update repo
Browse files- .gitignore +4 -0
- pages/1_parsing_demo.py +3 -4
- requirements.txt +2 -2
.gitignore
CHANGED
@@ -159,5 +159,9 @@ cython_debug/
|
|
159 |
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
160 |
#.idea/
|
161 |
|
|
|
162 |
.python-version
|
163 |
.DS_Store
|
|
|
|
|
|
|
|
159 |
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
160 |
#.idea/
|
161 |
|
162 |
+
# Project specific
|
163 |
.python-version
|
164 |
.DS_Store
|
165 |
+
|
166 |
+
# VS Code
|
167 |
+
.vscode/
|
pages/1_parsing_demo.py
CHANGED
@@ -20,7 +20,7 @@ def format_morph(morph):
|
|
20 |
def analyze_text(text):
|
21 |
doc = nlp(text)
|
22 |
rows = []
|
23 |
-
for token in doc[:
|
24 |
rows.append(
|
25 |
(
|
26 |
token.text,
|
@@ -55,8 +55,7 @@ st.title("LatinCy Text Analyzer")
|
|
55 |
|
56 |
# Using object notation
|
57 |
model_selectbox = st.sidebar.selectbox(
|
58 |
-
"Choose model:",
|
59 |
-
("la_core_web_lg", "la_core_web_md", "la_core_web_sm")
|
60 |
)
|
61 |
|
62 |
nlp = spacy.load(model_selectbox)
|
@@ -64,7 +63,7 @@ nlp = spacy.load(model_selectbox)
|
|
64 |
df = None
|
65 |
|
66 |
text = st.text_area(
|
67 |
-
"Enter some text to analyze (max
|
68 |
)
|
69 |
if st.button("Analyze"):
|
70 |
df = analyze_text(text)
|
|
|
20 |
def analyze_text(text):
|
21 |
doc = nlp(text)
|
22 |
rows = []
|
23 |
+
for token in doc[:500]:
|
24 |
rows.append(
|
25 |
(
|
26 |
token.text,
|
|
|
55 |
|
56 |
# Using object notation
|
57 |
model_selectbox = st.sidebar.selectbox(
|
58 |
+
"Choose model:", ("la_core_web_lg", "la_core_web_md", "la_core_web_sm")
|
|
|
59 |
)
|
60 |
|
61 |
nlp = spacy.load(model_selectbox)
|
|
|
63 |
df = None
|
64 |
|
65 |
text = st.text_area(
|
66 |
+
"Enter some text to analyze (max 500 tokens)", value=default_text, height=200
|
67 |
)
|
68 |
if st.button("Analyze"):
|
69 |
df = analyze_text(text)
|
requirements.txt
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
la-core-web-lg @ https://huggingface.co/latincy/la_core_web_lg/resolve/main/la_core_web_lg-any-py3-none-any.whl
|
2 |
la-core-web-md @ https://huggingface.co/latincy/la_core_web_md/resolve/main/la_core_web_md-any-py3-none-any.whl
|
3 |
la-core-web-sm @ https://huggingface.co/latincy/la_core_web_sm/resolve/main/la_core_web_sm-any-py3-none-any.whl
|
4 |
-
pandas==2.
|
5 |
-
spacy==3.7.
|
6 |
spacy-streamlit==1.0.6
|
7 |
streamlit==1.29.0
|
|
|
1 |
la-core-web-lg @ https://huggingface.co/latincy/la_core_web_lg/resolve/main/la_core_web_lg-any-py3-none-any.whl
|
2 |
la-core-web-md @ https://huggingface.co/latincy/la_core_web_md/resolve/main/la_core_web_md-any-py3-none-any.whl
|
3 |
la-core-web-sm @ https://huggingface.co/latincy/la_core_web_sm/resolve/main/la_core_web_sm-any-py3-none-any.whl
|
4 |
+
pandas==2.2.2
|
5 |
+
spacy==3.7.4
|
6 |
spacy-streamlit==1.0.6
|
7 |
streamlit==1.29.0
|