Spaces:
Sleeping
Sleeping
Futyn-Maker
commited on
Commit
·
0fe87b7
1
Parent(s):
3d3f4cd
Fix color problems
Browse files
app.py
CHANGED
@@ -68,7 +68,7 @@ def highlight_span(
|
|
68 |
highlighted = text[span_start:span_end]
|
69 |
after = text[span_end:]
|
70 |
|
71 |
-
return f'{before}<mark style="background-color: #
|
72 |
|
73 |
|
74 |
def create_construction_link(construction_id: str, pattern: str) -> str:
|
@@ -114,7 +114,7 @@ def format_pipeline_results(results: Dict[str, Any]) -> str:
|
|
114 |
span_info['span_string']
|
115 |
)
|
116 |
html_parts.append(
|
117 |
-
f"<div style='font-size: 16px; line-height: 1.5; margin-top: 10px; padding: 10px; background-color:
|
118 |
|
119 |
# Span details
|
120 |
html_parts.append(
|
@@ -124,7 +124,7 @@ def format_pipeline_results(results: Dict[str, Any]) -> str:
|
|
124 |
html_parts.append("</div>")
|
125 |
else:
|
126 |
html_parts.append(
|
127 |
-
f"<div style='font-size: 16px; line-height: 1.5; margin-top: 10px; padding: 10px; background-color:
|
128 |
html_parts.append(
|
129 |
"<div style='margin-top: 8px; font-size: 12px; color: #999;'>No specific span identified</div>")
|
130 |
|
@@ -167,7 +167,7 @@ def format_span_results(text: str, results: List[Dict[str, Any]]) -> str:
|
|
167 |
span_info['span_string']
|
168 |
)
|
169 |
html_parts.append(
|
170 |
-
f"<div style='font-size: 16px; line-height: 1.5; margin-top: 10px; padding: 10px; background-color:
|
171 |
|
172 |
# Span details
|
173 |
html_parts.append(
|
@@ -177,7 +177,7 @@ def format_span_results(text: str, results: List[Dict[str, Any]]) -> str:
|
|
177 |
html_parts.append("</div>")
|
178 |
else:
|
179 |
html_parts.append(
|
180 |
-
f"<div style='font-size: 16px; line-height: 1.5; margin-top: 10px; padding: 10px; background-color:
|
181 |
html_parts.append(
|
182 |
"<div style='margin-top: 8px; font-size: 12px; color: #999;'>No span found for this pattern</div>")
|
183 |
|
|
|
68 |
highlighted = text[span_start:span_end]
|
69 |
after = text[span_end:]
|
70 |
|
71 |
+
return f'{before}<mark style="background-color: #64b5f6; color: #1565c0; padding: 2px 4px; border-radius: 3px; font-weight: bold;">{highlighted}</mark>{after}'
|
72 |
|
73 |
|
74 |
def create_construction_link(construction_id: str, pattern: str) -> str:
|
|
|
114 |
span_info['span_string']
|
115 |
)
|
116 |
html_parts.append(
|
117 |
+
f"<div style='font-size: 16px; line-height: 1.5; margin-top: 10px; padding: 10px; background-color: #f8f9fa; border-radius: 4px; border: 1px solid #ddd; color: #333;'>{highlighted_text}</div>")
|
118 |
|
119 |
# Span details
|
120 |
html_parts.append(
|
|
|
124 |
html_parts.append("</div>")
|
125 |
else:
|
126 |
html_parts.append(
|
127 |
+
f"<div style='font-size: 16px; line-height: 1.5; margin-top: 10px; padding: 10px; background-color: #f8f9fa; border-radius: 4px; border: 1px solid #ddd; color: #333;'>{original_text}</div>")
|
128 |
html_parts.append(
|
129 |
"<div style='margin-top: 8px; font-size: 12px; color: #999;'>No specific span identified</div>")
|
130 |
|
|
|
167 |
span_info['span_string']
|
168 |
)
|
169 |
html_parts.append(
|
170 |
+
f"<div style='font-size: 16px; line-height: 1.5; margin-top: 10px; padding: 10px; background-color: #f8f9fa; border-radius: 4px; border: 1px solid #ddd; color: #333;'>{highlighted_text}</div>")
|
171 |
|
172 |
# Span details
|
173 |
html_parts.append(
|
|
|
177 |
html_parts.append("</div>")
|
178 |
else:
|
179 |
html_parts.append(
|
180 |
+
f"<div style='font-size: 16px; line-height: 1.5; margin-top: 10px; padding: 10px; background-color: #f8f9fa; border-radius: 4px; border: 1px solid #ddd; color: #333;'>{text}</div>")
|
181 |
html_parts.append(
|
182 |
"<div style='margin-top: 8px; font-size: 12px; color: #999;'>No span found for this pattern</div>")
|
183 |
|