Hakyung Sung commited on
Commit
7cabc55
·
1 Parent(s): 1c63838

Correct app.py

Browse files
Files changed (1) hide show
  1. app.py +21 -3
app.py CHANGED
@@ -51,13 +51,13 @@ def get_highlighted_text(doc):
51
  background-color: #f4f4f4;
52
  }
53
  .container {
54
- max-width: 800px;
55
  margin: 0 auto;
56
  padding: 20px;
57
  background-color: white;
58
  border-radius: 8px;
59
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
60
- line-height: 2em; /* Increased line spacing */
61
  }
62
  .entity {
63
  display: inline-block;
@@ -149,6 +149,24 @@ def get_highlighted_text(doc):
149
  min-width: 50px;
150
  white-space: nowrap;
151
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
152
  </style>
153
  """
154
  return style + "<div class='container'>" + result + "</div>"
@@ -172,7 +190,7 @@ def process_text(input_text):
172
  return get_highlighted_text(doc)
173
 
174
  # Define a simpler sample text.
175
- sample_text = "Oliver baked magical bread. Lyla enjoyed the treat."
176
 
177
  def fill_sample_text():
178
  return sample_text
 
51
  background-color: #f4f4f4;
52
  }
53
  .container {
54
+ max-width: 1000px;
55
  margin: 0 auto;
56
  padding: 20px;
57
  background-color: white;
58
  border-radius: 8px;
59
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
60
+ line-height: 3em; /* Increased line spacing */
61
  }
62
  .entity {
63
  display: inline-block;
 
149
  min-width: 50px;
150
  white-space: nowrap;
151
  }
152
+ /* Dark mode adjustments */
153
+ @media (prefers-color-scheme: dark) {
154
+ body {
155
+ background-color: #181818;
156
+ color: #e0e0e0;
157
+ }
158
+ .container {
159
+ background-color: #282828;
160
+ box-shadow: 0 0 10px rgba(255, 255, 255, 0.1);
161
+ }
162
+ /* Ensure text inside entities is visible in dark mode */
163
+ .entity {
164
+ color: #e0e0e0;
165
+ }
166
+ .entity::after {
167
+ color: #fff;
168
+ }
169
+ }
170
  </style>
171
  """
172
  return style + "<div class='container'>" + result + "</div>"
 
190
  return get_highlighted_text(doc)
191
 
192
  # Define a simpler sample text.
193
+ sample_text = "Nancy sliced the tire open."
194
 
195
  def fill_sample_text():
196
  return sample_text