Commit
·
9f3e682
1
Parent(s):
4fd1dad
fr to en translated
Browse files- .gitignore +1 -0
- app.py +16 -15
.gitignore
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
.DS_Store
|
app.py
CHANGED
|
@@ -83,7 +83,7 @@ def create_radar_plot(patent_rating: PatentRating):
|
|
| 83 |
patent_rating.completeness,
|
| 84 |
patent_rating.clarity
|
| 85 |
]
|
| 86 |
-
theta_categories = ['
|
| 87 |
|
| 88 |
# Close area loop
|
| 89 |
plot_r = r_values + [r_values[0]]
|
|
@@ -114,9 +114,9 @@ def create_radar_plot(patent_rating: PatentRating):
|
|
| 114 |
ticks=''
|
| 115 |
),
|
| 116 |
angularaxis=dict(
|
| 117 |
-
tickfont=dict(size=14)
|
| 118 |
),
|
| 119 |
-
domain=dict(x=[0.1, 0.9], y=[0.1, 0.9])
|
| 120 |
),
|
| 121 |
showlegend=False,
|
| 122 |
# Show the average value as a large, bold annotation in the center
|
|
@@ -134,11 +134,10 @@ def create_radar_plot(patent_rating: PatentRating):
|
|
| 134 |
)
|
| 135 |
)
|
| 136 |
],
|
| 137 |
-
title=f'
|
| 138 |
font=dict(size=12),
|
| 139 |
-
# Plus d'espace pour les labels
|
| 140 |
margin=dict(l=40, r=40, t=60, b=40),
|
| 141 |
-
height=450,
|
| 142 |
autosize=True
|
| 143 |
)
|
| 144 |
|
|
@@ -162,7 +161,7 @@ def generate_country_map(patents_data):
|
|
| 162 |
projection="orthographic",
|
| 163 |
)
|
| 164 |
fig.update_layout(
|
| 165 |
-
title="
|
| 166 |
title_x=0.5,
|
| 167 |
paper_bgcolor='rgba(0,0,0,0)',
|
| 168 |
plot_bgcolor='rgba(0,0,0,0)',
|
|
@@ -182,9 +181,9 @@ def generate_country_map(patents_data):
|
|
| 182 |
|
| 183 |
# Mapping for special patent codes
|
| 184 |
special_patent_codes = {
|
| 185 |
-
'EP': {'name': 'Union
|
| 186 |
-
'WO': {'name': '
|
| 187 |
-
'PCT': {'name': '
|
| 188 |
}
|
| 189 |
|
| 190 |
map_data = []
|
|
@@ -226,7 +225,7 @@ def generate_country_map(patents_data):
|
|
| 226 |
projection="orthographic",
|
| 227 |
)
|
| 228 |
fig.update_layout(
|
| 229 |
-
title="
|
| 230 |
title_x=0.5,
|
| 231 |
paper_bgcolor='rgba(0,0,0,0)',
|
| 232 |
plot_bgcolor='rgba(0,0,0,0)',
|
|
@@ -266,11 +265,11 @@ def generate_country_map(patents_data):
|
|
| 266 |
# Change colour to preference.
|
| 267 |
fig.update_traces(
|
| 268 |
marker=dict(color='red'),
|
| 269 |
-
hovertemplate="<b>%{hovertext}</b><br>
|
| 270 |
)
|
| 271 |
|
| 272 |
fig.update_layout(
|
| 273 |
-
title="
|
| 274 |
title_x=0.5,
|
| 275 |
paper_bgcolor='rgba(0,0,0,0)',
|
| 276 |
plot_bgcolor='rgba(0,0,0,0)',
|
|
@@ -700,5 +699,7 @@ with gr.Blocks(theme=gr.themes.Soft(primary_hue="indigo", secondary_hue="blue"),
|
|
| 700 |
|
| 701 |
|
| 702 |
if __name__ == "__main__":
|
| 703 |
-
app.queue(
|
| 704 |
-
|
|
|
|
|
|
|
|
|
| 83 |
patent_rating.completeness,
|
| 84 |
patent_rating.clarity
|
| 85 |
]
|
| 86 |
+
theta_categories = ['Novelty', 'Inventive Step', 'Utility', 'Completeness', 'Clarity']
|
| 87 |
|
| 88 |
# Close area loop
|
| 89 |
plot_r = r_values + [r_values[0]]
|
|
|
|
| 114 |
ticks=''
|
| 115 |
),
|
| 116 |
angularaxis=dict(
|
| 117 |
+
tickfont=dict(size=14)
|
| 118 |
),
|
| 119 |
+
domain=dict(x=[0.1, 0.9], y=[0.1, 0.9])
|
| 120 |
),
|
| 121 |
showlegend=False,
|
| 122 |
# Show the average value as a large, bold annotation in the center
|
|
|
|
| 134 |
)
|
| 135 |
)
|
| 136 |
],
|
| 137 |
+
title=f'Patent Strength Score: {average_value:.2f}/10',
|
| 138 |
font=dict(size=12),
|
|
|
|
| 139 |
margin=dict(l=40, r=40, t=60, b=40),
|
| 140 |
+
height=450,
|
| 141 |
autosize=True
|
| 142 |
)
|
| 143 |
|
|
|
|
| 161 |
projection="orthographic",
|
| 162 |
)
|
| 163 |
fig.update_layout(
|
| 164 |
+
title="No patents found",
|
| 165 |
title_x=0.5,
|
| 166 |
paper_bgcolor='rgba(0,0,0,0)',
|
| 167 |
plot_bgcolor='rgba(0,0,0,0)',
|
|
|
|
| 181 |
|
| 182 |
# Mapping for special patent codes
|
| 183 |
special_patent_codes = {
|
| 184 |
+
'EP': {'name': 'European Union (EP)', 'iso3': 'EUR', 'lat': 50.8503, 'lon': 4.3517}, # Brussels
|
| 185 |
+
'WO': {'name': 'World Organization (WO)', 'iso3': 'CHE', 'lat': 46.5197, 'lon': 6.6323}, # Geneva
|
| 186 |
+
'PCT': {'name': 'PCT Treaty', 'iso3': 'CHE', 'lat': 46.5197, 'lon': 6.6323}, # Geneva
|
| 187 |
}
|
| 188 |
|
| 189 |
map_data = []
|
|
|
|
| 225 |
projection="orthographic",
|
| 226 |
)
|
| 227 |
fig.update_layout(
|
| 228 |
+
title="No valid countries found",
|
| 229 |
title_x=0.5,
|
| 230 |
paper_bgcolor='rgba(0,0,0,0)',
|
| 231 |
plot_bgcolor='rgba(0,0,0,0)',
|
|
|
|
| 265 |
# Change colour to preference.
|
| 266 |
fig.update_traces(
|
| 267 |
marker=dict(color='red'),
|
| 268 |
+
hovertemplate="<b>%{hovertext}</b><br>Patents: %{customdata[0]}<extra></extra>"
|
| 269 |
)
|
| 270 |
|
| 271 |
fig.update_layout(
|
| 272 |
+
title="Geographical distribution of similar patents",
|
| 273 |
title_x=0.5,
|
| 274 |
paper_bgcolor='rgba(0,0,0,0)',
|
| 275 |
plot_bgcolor='rgba(0,0,0,0)',
|
|
|
|
| 699 |
|
| 700 |
|
| 701 |
if __name__ == "__main__":
|
| 702 |
+
app.queue(
|
| 703 |
+
default_concurrency_limit=20,
|
| 704 |
+
max_size=50
|
| 705 |
+
).launch(mcp_server=True, share=True)
|