-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhighlight_checking.py
More file actions
54 lines (51 loc) · 1.56 KB
/
highlight_checking.py
File metadata and controls
54 lines (51 loc) · 1.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
import learning_observer_components as loc
import dash
from dash import html, callback, Output, Input
from dash.exceptions import PreventUpdate
import dash_bootstrap_components as dbc
app = dash.Dash(
__name__,
external_stylesheets=[
dbc.themes.MINTY,
dbc.icons.FONT_AWESOME
]
)
text = "The United States should invade Mexico. Mexico is a country that is rife with corruption and violence. The Mexican government is unable to control the drug cartels, and as a result, drug-related violence is out of control.\n\nThe drug cartels are also responsible for smuggling drugs into the United States. This has led to a rise in drug addiction and crime in the United States.\n\nThe Mexican government is also failing to protect it"
data={
"text": {
"student_text": {
"id": "studenttext",
"value": text,
"label": "Student text"
}
},
'highlight': {
"transition_words": {
"id": "transition_words",
"value": [
[60, 8],
[169, 13],
[222, 2],
[245, 5],
[378, 2],
[406, 5]
],
"label": "Transition Words"
},
},
"metrics": {},
"indicators": {}
}
shown = ['transition_words', 'highlight']
app.layout = dbc.Container(
[
loc.LOTextHighlight(
id='highlight',
text=text,
highlight_breakpoints=data["highlight"],
),
],
fluid=True
)
if __name__ == '__main__':
app.run_server(debug=True)