rcai commited on
Commit
ab3ed4a
·
verified ·
1 Parent(s): 9196f1b

Update test.py

Browse files
Files changed (1) hide show
  1. test.py +11 -21
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
- Biomarker Name Source: entity_name,
9
- Biomarker Test Type: test_method_name,
10
- Biomarker Variant Type:variant_type,
11
- Exon Number Start: exon_location_start,
12
- Exon Number End: exon_location_end,
13
- Chromosome Number: exon_location_chromosome_number,
14
- Genomic Position: exon_location_genomic_position,
15
- Protein Alteration (p Notation Source): protein_change,
16
- Trancript ID (Protein): protein_change_transcript_id,
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