Spaces:
No application file
No application file
Update test.py
Browse files
test.py
CHANGED
|
@@ -1,28 +1,18 @@
|
|
| 1 |
import pandas as pd
|
| 2 |
import re
|
| 3 |
|
| 4 |
-
import pandas as pd
|
| 5 |
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
DNA Alteration (c notation Source): nucleotide_change,
|
| 18 |
-
DNA Alteration (c notation Source): nucleotide_change_transcript_id,
|
| 19 |
-
Biomarker Test Result Value Numeric 1: numeric_result_numeric_1,
|
| 20 |
-
Biomarker Test Result Value Numeric 2: numeric_result_numeric_2,
|
| 21 |
-
Biomarker Test Threshold Value Numeric 1: numeric_result_threshold_1,
|
| 22 |
-
Biomarker Test Threshold Value Numeric 2: numeric_result_threshold_2,
|
| 23 |
-
Biomarker Test Result Source: categorical_result
|
| 24 |
-
|
| 25 |
-
}
|
| 26 |
|
| 27 |
def extract_table(text):
|
| 28 |
# Find the start and end of the table
|
|
|
|
| 1 |
import pandas as pd
|
| 2 |
import re
|
| 3 |
|
|
|
|
| 4 |
|
| 5 |
+
json_string = re.search(r"```(.*?)```", llm_output, re.DOTALL).group(1).strip()
|
| 6 |
+
|
| 7 |
+
# Load the JSON string into a dictionary
|
| 8 |
+
data = json.loads(json_string)
|
| 9 |
+
|
| 10 |
+
# Convert the 'attributes' list to a DataFrame
|
| 11 |
+
df = pd.DataFrame(data['attributes'])
|
| 12 |
+
|
| 13 |
+
# Display the DataFrame
|
| 14 |
+
print(df)
|
| 15 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16 |
|
| 17 |
def extract_table(text):
|
| 18 |
# Find the start and end of the table
|