ando55 commited on
Commit
7b7d97b
·
1 Parent(s): 355ef59

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -13
app.py CHANGED
@@ -6,7 +6,7 @@ from functionforDownloadButtons import download_button
6
  import os
7
  import json
8
 
9
- os.system('git clone --depth 1 https://github.com/neologd/mecab-ipadic-neologd.git && cd mecab-ipadic-neologd && ./bin/install-mecab-ipadic-neologd -n -y -u -p $PWD')
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
- ["fullstop & linebreak (Default)", "pySBD"],
72
  help="""
73
- At present, you can choose between 2 methods to split your text into sentences.
74
 
75
- The fullstop & linebreak is naive and robust to noise, but has low accuracy.
76
- pySBD is more accurate, but more complex and less robust to noise.
77
  """,
78
  )
79
 
80
- if ModelType == "fullstop & linebreak (Default)":
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 below",
90
  "グラム染色するも明らかな菌が見つからず、 髄液培養でも優位な菌は培養されなかった。細菌性髄膜炎に対するグラム染色の感度は60%程度であり、培養に関しても感度は高くない。また髄液中の糖はもう少し減るのではないだろうか。確定診断はつかないものの、最も疑わしい疾患であった。起因菌はMRSA,腸内細菌等を広域にカバーするためバンコマイシン,メロペネム(髄膜炎dose)とした。",
91
- height=510,
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)")