Spaces:
Running
Running
Update curated.py
Browse files- curated.py +31 -4
curated.py
CHANGED
|
@@ -485,7 +485,34 @@ wiki_examples = Div(
|
|
| 485 |
),
|
| 486 |
)
|
| 487 |
|
|
|
|
|
|
|
| 488 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 489 |
|
| 490 |
filtering_process = Div(
|
| 491 |
Section(
|
|
@@ -695,10 +722,10 @@ filtering_process = Div(
|
|
| 695 |
Li("Local dedup was done within freelaw itself which removed 90%+ duplicates"),
|
| 696 |
),
|
| 697 |
table_div_freelaw,
|
| 698 |
-
|
| 699 |
-
|
| 700 |
-
|
| 701 |
-
|
| 702 |
|
| 703 |
),
|
| 704 |
),
|
|
|
|
| 485 |
),
|
| 486 |
)
|
| 487 |
|
| 488 |
+
def get_freelaw_data(data_source: str = "Freelaw", doc_id: int = 3, target: str = "foo"):
|
| 489 |
+
doc_id = max(0, min(int(doc_id), 9))
|
| 490 |
|
| 491 |
+
if data_source == "Freelaw":
|
| 492 |
+
raw_sample_doc = json.load(open("data/curated_samples/freelaw_raw.json"))
|
| 493 |
+
extracted_sample_doc = json.load(
|
| 494 |
+
open("data/curated_samples/freelaw_extract.json")
|
| 495 |
+
)
|
| 496 |
+
else:
|
| 497 |
+
raw_sample_doc = extracted_sample_doc = [{} for _ in range(10)]
|
| 498 |
+
|
| 499 |
+
raw_json = raw_sample_doc[doc_id]
|
| 500 |
+
extracted_json = extracted_sample_doc[doc_id]
|
| 501 |
+
return view_data(
|
| 502 |
+
raw_json,
|
| 503 |
+
extracted_json,
|
| 504 |
+
doc_id=doc_id,
|
| 505 |
+
data_source="Freelaw",
|
| 506 |
+
data_sources="Freelaw",
|
| 507 |
+
target=target,
|
| 508 |
+
)
|
| 509 |
+
|
| 510 |
+
freelaw_examples = Div(
|
| 511 |
+
Div(
|
| 512 |
+
get_freelaw_data(target=gen_random_id()),
|
| 513 |
+
style="border: 1px solid #ccc; padding: 20px;",
|
| 514 |
+
),
|
| 515 |
+
)
|
| 516 |
|
| 517 |
filtering_process = Div(
|
| 518 |
Section(
|
|
|
|
| 722 |
Li("Local dedup was done within freelaw itself which removed 90%+ duplicates"),
|
| 723 |
),
|
| 724 |
table_div_freelaw,
|
| 725 |
+
Details(
|
| 726 |
+
Summary("FreeLaw Filtering Examples"),
|
| 727 |
+
freelaw_examples,
|
| 728 |
+
),
|
| 729 |
|
| 730 |
),
|
| 731 |
),
|