Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -23,25 +23,29 @@ css = """
|
|
| 23 |
<style>
|
| 24 |
.manuscript {
|
| 25 |
display: flex;
|
| 26 |
-
margin-bottom:
|
| 27 |
-
align-items:
|
| 28 |
}
|
| 29 |
.annotation {
|
| 30 |
-
width:
|
| 31 |
-
padding-right:
|
| 32 |
-
color: grey;
|
| 33 |
font-style: italic;
|
| 34 |
-
|
| 35 |
}
|
| 36 |
.content {
|
| 37 |
-
width:
|
| 38 |
}
|
| 39 |
h2 {
|
| 40 |
-
margin
|
| 41 |
-
|
| 42 |
}
|
| 43 |
-
.title-content {
|
| 44 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 45 |
}
|
| 46 |
</style>
|
| 47 |
"""
|
|
@@ -116,6 +120,8 @@ def transform_chunks(marianne_segmentation):
|
|
| 116 |
|
| 117 |
if entity_group == 'title':
|
| 118 |
html_output.append(f'<div class="manuscript"><div class="annotation">{result_entity}</div><div class="content title-content"><h2>{word}</h2></div></div>')
|
|
|
|
|
|
|
| 119 |
else:
|
| 120 |
html_output.append(f'<div class="manuscript"><div class="annotation">{result_entity}</div><div class="content">{word}</div></div>')
|
| 121 |
|
|
|
|
| 23 |
<style>
|
| 24 |
.manuscript {
|
| 25 |
display: flex;
|
| 26 |
+
margin-bottom: 10px;
|
| 27 |
+
align-items: baseline;
|
| 28 |
}
|
| 29 |
.annotation {
|
| 30 |
+
width: 20%;
|
| 31 |
+
padding-right: 10px;
|
| 32 |
+
color: grey !important;
|
| 33 |
font-style: italic;
|
| 34 |
+
text-align: right;
|
| 35 |
}
|
| 36 |
.content {
|
| 37 |
+
width: 80%;
|
| 38 |
}
|
| 39 |
h2 {
|
| 40 |
+
margin: 0;
|
| 41 |
+
font-size: 1.5em;
|
| 42 |
}
|
| 43 |
+
.title-content h2 {
|
| 44 |
+
font-weight: bold;
|
| 45 |
+
}
|
| 46 |
+
.bibliography-content {
|
| 47 |
+
color:darkgreen !important;
|
| 48 |
+
margin-top: -5px; /* Adjust if needed to align with annotation */
|
| 49 |
}
|
| 50 |
</style>
|
| 51 |
"""
|
|
|
|
| 120 |
|
| 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">[{annotation}]</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 |
|