Spaces:
Running
Running
Bor Hodošček
commited on
chore: add comment
Browse files
app.py
CHANGED
|
@@ -23,6 +23,8 @@
|
|
| 23 |
# en-core-web-sm = { url = "https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-3.8.0/en_core_web_sm-3.8.0-py3-none-any.whl" }
|
| 24 |
# ///
|
| 25 |
|
|
|
|
|
|
|
| 26 |
import marimo
|
| 27 |
|
| 28 |
__generated_with = "0.14.10"
|
|
@@ -1173,7 +1175,9 @@ def _(
|
|
| 1173 |
|
| 1174 |
@app.cell
|
| 1175 |
def sample_selector(fnames):
|
| 1176 |
-
selector_explanation = mo.md(
|
|
|
|
|
|
|
| 1177 |
|
| 1178 |
text_selector = mo.ui.dropdown(
|
| 1179 |
options=list(sorted(fnames)),
|
|
@@ -1196,7 +1200,9 @@ def sample_viewer(fnames, text_selector, texts):
|
|
| 1196 |
|
| 1197 |
@app.cell
|
| 1198 |
def _():
|
| 1199 |
-
kwic_explanation = mo.md(
|
|
|
|
|
|
|
| 1200 |
keyword = mo.ui.text(label="Search keyword")
|
| 1201 |
context_chars = mo.ui.number(label="Context chars", start=0, value=50)
|
| 1202 |
run_btn = mo.ui.run_button(label="Search")
|
|
@@ -1230,16 +1236,12 @@ def _(
|
|
| 1230 |
"speech_type": speech_types,
|
| 1231 |
}
|
| 1232 |
)
|
| 1233 |
-
merged = (
|
| 1234 |
-
|
| 1235 |
-
|
| 1236 |
-
|
| 1237 |
-
|
| 1238 |
-
|
| 1239 |
-
validate="many_to_one",
|
| 1240 |
-
)
|
| 1241 |
-
.drop(columns=["original_index", "sample_index"])
|
| 1242 |
-
)
|
| 1243 |
kwic_display = mo.ui.table(merged, selection=None)
|
| 1244 |
|
| 1245 |
kwic_display
|
|
|
|
| 23 |
# en-core-web-sm = { url = "https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-3.8.0/en_core_web_sm-3.8.0-py3-none-any.whl" }
|
| 24 |
# ///
|
| 25 |
|
| 26 |
+
# Note that the above dependencies should be kept in sync with pyproject.toml
|
| 27 |
+
|
| 28 |
import marimo
|
| 29 |
|
| 30 |
__generated_with = "0.14.10"
|
|
|
|
| 1175 |
|
| 1176 |
@app.cell
|
| 1177 |
def sample_selector(fnames):
|
| 1178 |
+
selector_explanation = mo.md(
|
| 1179 |
+
"## データの確認\n\n### サンプルの確認\n\n以下の選択肢から任意のサンプルを選ぶとその中身が確認できます。"
|
| 1180 |
+
)
|
| 1181 |
|
| 1182 |
text_selector = mo.ui.dropdown(
|
| 1183 |
options=list(sorted(fnames)),
|
|
|
|
| 1200 |
|
| 1201 |
@app.cell
|
| 1202 |
def _():
|
| 1203 |
+
kwic_explanation = mo.md(
|
| 1204 |
+
"### KWIC検索\n\nKeyWord In Context (KWIC)は検索語の左右コンテクストを効率的に確認できる可視化方法です。"
|
| 1205 |
+
)
|
| 1206 |
keyword = mo.ui.text(label="Search keyword")
|
| 1207 |
context_chars = mo.ui.number(label="Context chars", start=0, value=50)
|
| 1208 |
run_btn = mo.ui.run_button(label="Search")
|
|
|
|
| 1236 |
"speech_type": speech_types,
|
| 1237 |
}
|
| 1238 |
)
|
| 1239 |
+
merged = kwic_df.merge(
|
| 1240 |
+
meta,
|
| 1241 |
+
left_on="original_index",
|
| 1242 |
+
right_on="sample_index",
|
| 1243 |
+
validate="many_to_one",
|
| 1244 |
+
).drop(columns=["original_index", "sample_index"])
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1245 |
kwic_display = mo.ui.table(merged, selection=None)
|
| 1246 |
|
| 1247 |
kwic_display
|