nlp.py 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. from dash import html, dcc
  2. import dash_bootstrap_components as dbc
  3. def NLPLayout():
  4. return html.Div([
  5. html.H2("NLP Management"),
  6. dbc.Button("Start NLP Training", id="start-training-nlp", color="primary", className="mb-3"),
  7. dbc.Toast(
  8. id="nlp-training-status",
  9. header="Training Status",
  10. is_open=False,
  11. dismissable=True,
  12. icon="info",
  13. ),
  14. html.H3("Upload NLP Data"),
  15. dcc.Upload(
  16. id="upload-nlp-data",
  17. children=html.Div([
  18. 'Drag and Drop or ',
  19. html.A('Select Files')
  20. ]),
  21. style={
  22. 'width': '100%',
  23. 'height': '60px',
  24. 'lineHeight': '60px',
  25. 'borderWidth': '1px',
  26. 'borderStyle': 'dashed',
  27. 'borderRadius': '5px',
  28. 'textAlign': 'center',
  29. 'margin': '10px'
  30. },
  31. multiple=True
  32. ),
  33. html.Div(id="nlp-data-upload-status"),
  34. dbc.Button("Refresh NLP Data", id="refresh-nlp-data", color="secondary", className="mt-3"),
  35. html.Div(id="nlp-data-display"),
  36. dbc.Button("Refresh NLP Model Status", id="refresh-nlp-model-status", color="secondary", className="mt-3"),
  37. html.Div(id="nlp-model-status"),
  38. ])