omkarenator commited on
Commit
2ee1e66
1 Parent(s): 9db0440

add tables

Browse files
Files changed (1) hide show
  1. main.py +39 -1
main.py CHANGED
@@ -1,6 +1,7 @@
1
  from fasthtml.common import *
2
  from fasthtml.components import *
3
  from fasthtml.components import D_title, D_article, D_front_matter, D_contents, D_byline
 
4
  from plotly import graph_objects as go
5
  from fh_plotly import plotly2fasthtml
6
  import pandas as pd
@@ -309,8 +310,45 @@ def get_chart_28168342():
309
 
310
  @app.get("/curated")
311
  def curated():
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
312
  return Div(
313
- H2("Curated Sources"), plotly2fasthtml(get_chart_28168342()), id="inner-text"
 
 
 
 
 
314
  )
315
 
316
 
 
1
  from fasthtml.common import *
2
  from fasthtml.components import *
3
  from fasthtml.components import D_title, D_article, D_front_matter, D_contents, D_byline
4
+ from fasthtml.components import HR
5
  from plotly import graph_objects as go
6
  from fh_plotly import plotly2fasthtml
7
  import pandas as pd
 
310
 
311
  @app.get("/curated")
312
  def curated():
313
+ hr = HR()
314
+ data_preparation_steps = pd.DataFrame(
315
+ {
316
+ "Method": [
317
+ "HTTP/FTP dumps",
318
+ "Web crawling",
319
+ "Archive snapshot",
320
+ "Generated",
321
+ "Curated",
322
+ ],
323
+ "Description": [
324
+ "Acquiring data from HTTP/FTP dumps",
325
+ "Crawling websites to extract data",
326
+ "Working with archive dumps",
327
+ "Generating synthetic data",
328
+ "High quality curated data",
329
+ ],
330
+ "Source": [
331
+ "Freelaw | Wikipedia | PhilPapers | Arxiv | S2ORC | Pubmeds",
332
+ "USPTO | Hackernews | Ubuntu IRC",
333
+ "StackExchange",
334
+ "DM Maths",
335
+ "PG19 | Europarl",
336
+ ],
337
+ }
338
+ )
339
+
340
+ data_preparation_steps.style.set_properties(
341
+ **{"padding-top": "10px", "padding-bottom": "10px"}
342
+ )
343
+ table_html = data_preparation_steps.to_html(index=False, border=0)
344
+ table_div = Div(NotStr(table_html), cls="l-body-outset")
345
  return Div(
346
+ H1("Curated Sources"),
347
+ plotly2fasthtml(get_chart_28168342()),
348
+ H2("Data Preparation"),
349
+ table_div,
350
+ H2("Data Preprocessing"),
351
+ id="inner-text",
352
  )
353
 
354