Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -6,7 +6,7 @@ from functionforDownloadButtons import download_button
|
|
6 |
import os
|
7 |
import json
|
8 |
|
9 |
-
|
10 |
os.system('git clone --depth 1 https://github.com/neologd/mecab-unidic-neologd.git && cd mecab-unidic-neologd && ./bin/install-mecab-unidic-neologd -n -y -u -p $PWD')
|
11 |
|
12 |
|
@@ -56,7 +56,7 @@ with st.expander("ℹ️ - About this app", expanded=True):
|
|
56 |
st.markdown("")
|
57 |
|
58 |
st.markdown("")
|
59 |
-
st.markdown("## 📌 Paste document")
|
60 |
@st.cache(allow_output_mutation=True)
|
61 |
def model_load():
|
62 |
return run_segbot.setup()
|
@@ -68,16 +68,16 @@ with st.form(key="my_form"):
|
|
68 |
with c1:
|
69 |
ModelType = st.radio(
|
70 |
"Choose the method of sentence split",
|
71 |
-
["
|
72 |
help="""
|
73 |
-
|
74 |
|
75 |
-
The
|
76 |
-
|
77 |
""",
|
78 |
)
|
79 |
|
80 |
-
if ModelType == "
|
81 |
split_method="fullstop"
|
82 |
|
83 |
else:
|
@@ -86,12 +86,12 @@ with st.form(key="my_form"):
|
|
86 |
|
87 |
with c2:
|
88 |
doc = st.text_area(
|
89 |
-
"Paste your text
|
90 |
"グラム染色するも明らかな菌が見つからず、 髄液培養でも優位な菌は培養されなかった。細菌性髄膜炎に対するグラム染色の感度は60%程度であり、培養に関しても感度は高くない。また髄液中の糖はもう少し減るのではないだろうか。確定診断はつかないものの、最も疑わしい疾患であった。起因菌はMRSA,腸内細菌等を広域にカバーするためバンコマイシン,メロペネム(髄膜炎dose)とした。",
|
91 |
-
height=
|
92 |
)
|
93 |
|
94 |
-
submit_button = st.form_submit_button(label="Go to split
|
95 |
|
96 |
|
97 |
if not submit_button:
|
@@ -115,12 +115,13 @@ df.columns = ['Segment']
|
|
115 |
print(df)
|
116 |
|
117 |
|
|
|
|
|
|
|
|
|
118 |
with c1:
|
119 |
CSVButton2 = download_button(keywords, "Data.csv", "📥 Download (.csv)")
|
120 |
with c2:
|
121 |
CSVButton2 = download_button(keywords, "Data.txt", "📥 Download (.txt)")
|
122 |
with c3:
|
123 |
CSVButton2 = download_button(keywords, "Data.json", "📥 Download (.json)")
|
124 |
-
|
125 |
-
#with c2:
|
126 |
-
st.table(df)
|
|
|
6 |
import os
|
7 |
import json
|
8 |
|
9 |
+
|
10 |
os.system('git clone --depth 1 https://github.com/neologd/mecab-unidic-neologd.git && cd mecab-unidic-neologd && ./bin/install-mecab-unidic-neologd -n -y -u -p $PWD')
|
11 |
|
12 |
|
|
|
56 |
st.markdown("")
|
57 |
|
58 |
st.markdown("")
|
59 |
+
#st.markdown("## 📌 Paste document")
|
60 |
@st.cache(allow_output_mutation=True)
|
61 |
def model_load():
|
62 |
return run_segbot.setup()
|
|
|
68 |
with c1:
|
69 |
ModelType = st.radio(
|
70 |
"Choose the method of sentence split",
|
71 |
+
["pySBD (Default)", "full stop & linebreak"],
|
72 |
help="""
|
73 |
+
We have prepared 2 methods to break input text into sentences.
|
74 |
|
75 |
+
- The [pySBD](https://github.com/nipunsadvilkar/pySBD) is a more accurate method.
|
76 |
+
- The full stop & linebreak is naive and has low accuracy, but can be robust to noise.
|
77 |
""",
|
78 |
)
|
79 |
|
80 |
+
if ModelType == "full stop & linebreak":
|
81 |
split_method="fullstop"
|
82 |
|
83 |
else:
|
|
|
86 |
|
87 |
with c2:
|
88 |
doc = st.text_area(
|
89 |
+
"Paste your text",
|
90 |
"グラム染色するも明らかな菌が見つからず、 髄液培養でも優位な菌は培養されなかった。細菌性髄膜炎に対するグラム染色の感度は60%程度であり、培養に関しても感度は高くない。また髄液中の糖はもう少し減るのではないだろうか。確定診断はつかないものの、最も疑わしい疾患であった。起因菌はMRSA,腸内細菌等を広域にカバーするためバンコマイシン,メロペネム(髄膜炎dose)とした。",
|
91 |
+
height=250,
|
92 |
)
|
93 |
|
94 |
+
submit_button = st.form_submit_button(label="Go to split!")
|
95 |
|
96 |
|
97 |
if not submit_button:
|
|
|
115 |
print(df)
|
116 |
|
117 |
|
118 |
+
#with c2:
|
119 |
+
st.table(df)
|
120 |
+
|
121 |
+
|
122 |
with c1:
|
123 |
CSVButton2 = download_button(keywords, "Data.csv", "📥 Download (.csv)")
|
124 |
with c2:
|
125 |
CSVButton2 = download_button(keywords, "Data.txt", "📥 Download (.txt)")
|
126 |
with c3:
|
127 |
CSVButton2 = download_button(keywords, "Data.json", "📥 Download (.json)")
|
|
|
|
|
|