Spaces:
Running
Running
Pclanglais
commited on
Commit
•
1af25ec
1
Parent(s):
762f02d
Update app.py
Browse files
app.py
CHANGED
@@ -47,6 +47,11 @@ h2 {
|
|
47 |
color:darkgreen !important;
|
48 |
margin-top: -5px; /* Adjust if needed to align with annotation */
|
49 |
}
|
|
|
|
|
|
|
|
|
|
|
50 |
</style>
|
51 |
"""
|
52 |
|
@@ -122,6 +127,8 @@ def transform_chunks(marianne_segmentation):
|
|
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 |
|
@@ -151,7 +158,7 @@ class MistralChatBot:
|
|
151 |
|
152 |
classified_list = pd.concat(classified_list)
|
153 |
out = transform_chunks(classified_list)
|
154 |
-
generated_text = f'{css}<h2 style="text-align:center">
|
155 |
return generated_text
|
156 |
|
157 |
# Create the Falcon chatbot instance
|
@@ -170,7 +177,7 @@ 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">Editorialize your text
|
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")
|
|
|
47 |
color:darkgreen !important;
|
48 |
margin-top: -5px; /* Adjust if needed to align with annotation */
|
49 |
}
|
50 |
+
|
51 |
+
.bibliography-content {
|
52 |
+
color:#a4a4a4;
|
53 |
+
margin-top: -5px; /* Adjust if needed to align with annotation */
|
54 |
+
}
|
55 |
</style>
|
56 |
"""
|
57 |
|
|
|
127 |
html_output.append(f'<div class="manuscript"><div class="annotation">{result_entity}</div><div class="content title-content"><h2>{word}</h2></div></div>')
|
128 |
elif entity_group == 'bibliography':
|
129 |
html_output.append(f'<div class="manuscript"><div class="annotation">{result_entity}</div><div class="content bibliography-content">{word}</div></div>')
|
130 |
+
elif entity_group == 'paratext':
|
131 |
+
html_output.append(f'<div class="manuscript"><div class="annotation">{result_entity}</div><div class="content paratext-content">{word}</div></div>')
|
132 |
else:
|
133 |
html_output.append(f'<div class="manuscript"><div class="annotation">{result_entity}</div><div class="content">{word}</div></div>')
|
134 |
|
|
|
158 |
|
159 |
classified_list = pd.concat(classified_list)
|
160 |
out = transform_chunks(classified_list)
|
161 |
+
generated_text = f'{css}<h2 style="text-align:center">Edited text</h2>\n<div class="generation">{out}</div>'
|
162 |
return generated_text
|
163 |
|
164 |
# Create the Falcon chatbot instance
|
|
|
177 |
demo = gr.Blocks()
|
178 |
|
179 |
with gr.Blocks(theme='JohnSmith9982/small_and_pretty') as demo:
|
180 |
+
gr.HTML("""<h1 style="text-align:center">Editorialize your text</h1>""")
|
181 |
text_input = gr.Textbox(label="Your text", type="text", lines=1)
|
182 |
text_button = gr.Button("Identify editorial structures")
|
183 |
text_output = gr.HTML(label="Corrected text")
|