Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -49,6 +49,11 @@ def extract_table_from_markdown(markdown_text, table_start):
|
|
49 |
|
50 |
# return df
|
51 |
|
|
|
|
|
|
|
|
|
|
|
52 |
def markdown_table_to_df(table_content):
|
53 |
"""Convert markdown table to pandas DataFrame."""
|
54 |
# Split the table content into lines
|
@@ -68,6 +73,10 @@ def markdown_table_to_df(table_content):
|
|
68 |
|
69 |
# Create DataFrame
|
70 |
df = pd.DataFrame(data, columns=headers)
|
|
|
|
|
|
|
|
|
71 |
|
72 |
# Convert numeric columns to float and handle Dimension column
|
73 |
for col in df.columns:
|
|
|
49 |
|
50 |
# return df
|
51 |
|
52 |
+
def extract_model_name(link):
|
53 |
+
"""Extract model name from markdown link."""
|
54 |
+
match = re.match(r'\[(.*?)\]\(.*?\)', link)
|
55 |
+
return match.group(1) if match else link
|
56 |
+
|
57 |
def markdown_table_to_df(table_content):
|
58 |
"""Convert markdown table to pandas DataFrame."""
|
59 |
# Split the table content into lines
|
|
|
73 |
|
74 |
# Create DataFrame
|
75 |
df = pd.DataFrame(data, columns=headers)
|
76 |
+
|
77 |
+
# Process 'Model Name' column to extract plain text from markdown link
|
78 |
+
if 'Model Name' in df.columns:
|
79 |
+
df['Model Name'] = df['Model Name'].apply(extract_model_name)
|
80 |
|
81 |
# Convert numeric columns to float and handle Dimension column
|
82 |
for col in df.columns:
|