Spaces:
Running
Running
Hakyung Sung
commited on
Commit
·
4feb757
1
Parent(s):
f3db826
edit
Browse files
app.py
CHANGED
@@ -52,13 +52,13 @@ def get_highlighted_text(doc):
|
|
52 |
color: #000;
|
53 |
}
|
54 |
.container {
|
55 |
-
max-width:
|
56 |
margin: 0 auto;
|
57 |
padding: 20px;
|
58 |
background-color: white;
|
59 |
border-radius: 8px;
|
60 |
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
|
61 |
-
line-height: 2em; /* Increased line spacing */
|
62 |
}
|
63 |
.entity {
|
64 |
display: inline-block;
|
@@ -74,11 +74,11 @@ def get_highlighted_text(doc):
|
|
74 |
color: inherit;
|
75 |
}
|
76 |
/* Highlight background colors for entity types */
|
77 |
-
.entity[data-entity="ATTR"] { background-color: #
|
78 |
.entity[data-entity="INTRAN_S"] { background-color: #e7957f; }
|
79 |
-
.entity[data-entity="INTRAN_MOT"] { background-color: #
|
80 |
-
.entity[data-entity="INTRAN_RES"] { background-color: #
|
81 |
-
.entity[data-entity="CAUS_MOT"] { background-color: #
|
82 |
.entity[data-entity="TRAN_S"] { background-color: #a0d4f7; }
|
83 |
.entity[data-entity="TRAN_RES"] { background-color: #c7aefa; }
|
84 |
.entity[data-entity="DITRAN"] { background-color: #b3f0f7; }
|
@@ -87,7 +87,7 @@ def get_highlighted_text(doc):
|
|
87 |
/* Darker background colors for the entity label tooltips */
|
88 |
.entity[data-entity="ATTR"]::after { background-color: #d29997; }
|
89 |
.entity[data-entity="INTRAN_S"]::after { background-color: #ec6161; }
|
90 |
-
.entity[data-entity="INTRAN_MOT"]::after { background-color: #
|
91 |
.entity[data-entity="INTRAN_RES"]::after { background-color: #be5791; }
|
92 |
.entity[data-entity="CAUS_MOT"]::after { background-color: #007030; }
|
93 |
.entity[data-entity="TRAN_S"]::after { background-color: #3085ce; }
|
@@ -158,14 +158,7 @@ def process_text(input_text):
|
|
158 |
return highlighted_html, total_count, dict(tag_counter)
|
159 |
|
160 |
sample_text = (
|
161 |
-
"
|
162 |
-
"With a steady hand and precise timing, she used a specially designed tool to cut through the stubborn rubber. "
|
163 |
-
"The tire, which had long been criticized for its premature wear, was examined closely by her team after being sliced open by Nancy. "
|
164 |
-
"Under the dim glow of the workshop lights, every careful stroke of the blade echoed her determination to uncover the truth. "
|
165 |
-
"Pressured by a looming deadline, Nancy repeated the process on another tire, ensuring that no defect escaped her scrutiny. "
|
166 |
-
"While some of her colleagues preferred following conventional procedures, she boldly argued that direct intervention was the most effective method. "
|
167 |
-
"By slicing the tire open, Nancy not only exposed the underlying damage but also revealed unexpected patterns of wear that puzzled even experienced mechanics. "
|
168 |
-
"Moreover, her innovative approach prompted heated discussions among her peers, ultimately leading to a complete re-evaluation of standard repair practices."
|
169 |
)
|
170 |
|
171 |
def fill_sample_text():
|
@@ -183,7 +176,7 @@ with gr.Blocks() as demo:
|
|
183 |
output_counts_by_type = gr.JSON(label="ASC counts by type")
|
184 |
|
185 |
tag_btn = gr.Button("Tag ASCs")
|
186 |
-
fill_btn = gr.Button("
|
187 |
|
188 |
fill_btn.click(fn=fill_sample_text, inputs=[], outputs=input_textbox)
|
189 |
tag_btn.click(
|
|
|
52 |
color: #000;
|
53 |
}
|
54 |
.container {
|
55 |
+
max-width: 1000px;
|
56 |
margin: 0 auto;
|
57 |
padding: 20px;
|
58 |
background-color: white;
|
59 |
border-radius: 8px;
|
60 |
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
|
61 |
+
line-height: 2.2em; /* Increased line spacing */
|
62 |
}
|
63 |
.entity {
|
64 |
display: inline-block;
|
|
|
74 |
color: inherit;
|
75 |
}
|
76 |
/* Highlight background colors for entity types */
|
77 |
+
.entity[data-entity="ATTR"] { background-color: #dbb6ab; }
|
78 |
.entity[data-entity="INTRAN_S"] { background-color: #e7957f; }
|
79 |
+
.entity[data-entity="INTRAN_MOT"] { background-color: #ebab22; }
|
80 |
+
.entity[data-entity="INTRAN_RES"] { background-color: #f095cc; }
|
81 |
+
.entity[data-entity="CAUS_MOT"] { background-color: #85a831; }
|
82 |
.entity[data-entity="TRAN_S"] { background-color: #a0d4f7; }
|
83 |
.entity[data-entity="TRAN_RES"] { background-color: #c7aefa; }
|
84 |
.entity[data-entity="DITRAN"] { background-color: #b3f0f7; }
|
|
|
87 |
/* Darker background colors for the entity label tooltips */
|
88 |
.entity[data-entity="ATTR"]::after { background-color: #d29997; }
|
89 |
.entity[data-entity="INTRAN_S"]::after { background-color: #ec6161; }
|
90 |
+
.entity[data-entity="INTRAN_MOT"]::after { background-color: #eb9422; }
|
91 |
.entity[data-entity="INTRAN_RES"]::after { background-color: #be5791; }
|
92 |
.entity[data-entity="CAUS_MOT"]::after { background-color: #007030; }
|
93 |
.entity[data-entity="TRAN_S"]::after { background-color: #3085ce; }
|
|
|
158 |
return highlighted_html, total_count, dict(tag_counter)
|
159 |
|
160 |
sample_text = (
|
161 |
+
"When, while the lovely valley teems with vapor around me, and the meridian sun strikes the upper surface of the impenetrable foliage of my trees, and but a few stray gleams steal into the inner sanctuary, I throw myself down among the tall grass by the trickling stream; and, as I lie close to the earth, a thousand unknown plants are noticed by me: when I hear the buzz of the little world among the stalks, and grow familiar with the countless indescribable forms of the insects and flies, then I feel the presence of the Almighty, who formed us in his own image, and the breath of that celestial force fills my lungs with an ineffable wonder, drawing my soul into a silent communion with the eternal rhythms of the earth."
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
162 |
)
|
163 |
|
164 |
def fill_sample_text():
|
|
|
176 |
output_counts_by_type = gr.JSON(label="ASC counts by type")
|
177 |
|
178 |
tag_btn = gr.Button("Tag ASCs")
|
179 |
+
fill_btn = gr.Button("Sample text")
|
180 |
|
181 |
fill_btn.click(fn=fill_sample_text, inputs=[], outputs=input_textbox)
|
182 |
tag_btn.click(
|