Spaces:
Running
Running
Pclanglais
commited on
Commit
•
762f02d
1
Parent(s):
81cb81d
Update app.py
Browse files
app.py
CHANGED
@@ -27,8 +27,8 @@ css = """
|
|
27 |
align-items: baseline;
|
28 |
}
|
29 |
.annotation {
|
30 |
-
width:
|
31 |
-
padding-right:
|
32 |
color: grey !important;
|
33 |
font-style: italic;
|
34 |
text-align: right;
|
@@ -121,7 +121,7 @@ def transform_chunks(marianne_segmentation):
|
|
121 |
if entity_group == 'title':
|
122 |
html_output.append(f'<div class="manuscript"><div class="annotation">{result_entity}</div><div class="content title-content"><h2>{word}</h2></div></div>')
|
123 |
elif entity_group == 'bibliography':
|
124 |
-
html_output.append(f'<div class="manuscript"><div class="annotation">
|
125 |
else:
|
126 |
html_output.append(f'<div class="manuscript"><div class="annotation">{result_entity}</div><div class="content">{word}</div></div>')
|
127 |
|
@@ -170,10 +170,10 @@ examples = [
|
|
170 |
demo = gr.Blocks()
|
171 |
|
172 |
with gr.Blocks(theme='JohnSmith9982/small_and_pretty') as demo:
|
173 |
-
gr.HTML("""<h1 style="text-align:center">
|
174 |
-
text_input = gr.Textbox(label="
|
175 |
-
text_button = gr.Button("
|
176 |
-
text_output = gr.HTML(label="
|
177 |
text_button.click(mistral_bot.predict, inputs=text_input, outputs=[text_output])
|
178 |
|
179 |
if __name__ == "__main__":
|
|
|
27 |
align-items: baseline;
|
28 |
}
|
29 |
.annotation {
|
30 |
+
width: 15%;
|
31 |
+
padding-right: 20px;
|
32 |
color: grey !important;
|
33 |
font-style: italic;
|
34 |
text-align: right;
|
|
|
121 |
if entity_group == 'title':
|
122 |
html_output.append(f'<div class="manuscript"><div class="annotation">{result_entity}</div><div class="content title-content"><h2>{word}</h2></div></div>')
|
123 |
elif entity_group == 'bibliography':
|
124 |
+
html_output.append(f'<div class="manuscript"><div class="annotation">{result_entity}</div><div class="content bibliography-content">{word}</div></div>')
|
125 |
else:
|
126 |
html_output.append(f'<div class="manuscript"><div class="annotation">{result_entity}</div><div class="content">{word}</div></div>')
|
127 |
|
|
|
170 |
demo = gr.Blocks()
|
171 |
|
172 |
with gr.Blocks(theme='JohnSmith9982/small_and_pretty') as demo:
|
173 |
+
gr.HTML("""<h1 style="text-align:center">Editorialize your text/h1>""")
|
174 |
+
text_input = gr.Textbox(label="Your text", type="text", lines=1)
|
175 |
+
text_button = gr.Button("Identify editorial structures")
|
176 |
+
text_output = gr.HTML(label="Corrected text")
|
177 |
text_button.click(mistral_bot.predict, inputs=text_input, outputs=[text_output])
|
178 |
|
179 |
if __name__ == "__main__":
|