mariagrandury
commited on
Commit
β’
a5766c6
1
Parent(s):
a912586
Implement MVP :)
Browse files- .gitignore +1 -0
- README.md +3 -5
- app.py +45 -0
- requirements.txt +2 -0
- spanish_nlp_initiatives.csv +2 -0
.gitignore
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
venv
|
README.md
CHANGED
@@ -1,13 +1,11 @@
|
|
1 |
---
|
2 |
-
title: Spanish
|
3 |
emoji: π¨
|
4 |
-
colorFrom:
|
5 |
-
colorTo:
|
6 |
sdk: gradio
|
7 |
sdk_version: 4.26.0
|
8 |
app_file: app.py
|
9 |
pinned: false
|
10 |
license: apache-2.0
|
11 |
---
|
12 |
-
|
13 |
-
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
1 |
---
|
2 |
+
title: Spanish NLP Initiatives
|
3 |
emoji: π¨
|
4 |
+
colorFrom: yellow
|
5 |
+
colorTo: yellow
|
6 |
sdk: gradio
|
7 |
sdk_version: 4.26.0
|
8 |
app_file: app.py
|
9 |
pinned: false
|
10 |
license: apache-2.0
|
11 |
---
|
|
|
|
app.py
ADDED
@@ -0,0 +1,45 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
import pandas as pd
|
3 |
+
|
4 |
+
df = pd.read_csv("spanish_nlp_initiatives.csv")
|
5 |
+
|
6 |
+
|
7 |
+
def update_table(search_query):
|
8 |
+
if search_query == "":
|
9 |
+
return df
|
10 |
+
else:
|
11 |
+
# Filter the dataframe based on the search query
|
12 |
+
filtered_df = df[
|
13 |
+
df.apply(
|
14 |
+
lambda row: row.astype(str)
|
15 |
+
.str.contains(search_query, case=False)
|
16 |
+
.any(),
|
17 |
+
axis=1,
|
18 |
+
)
|
19 |
+
]
|
20 |
+
return filtered_df
|
21 |
+
|
22 |
+
|
23 |
+
with gr.Blocks() as app:
|
24 |
+
gr.Markdown("# π Spanish NLP Initiatives")
|
25 |
+
gr.Markdown(
|
26 |
+
"Discover the initiatives driving NLP advancements in Spanish and other low-resource languages spoken in LatAm and Spain."
|
27 |
+
)
|
28 |
+
gr.Markdown(
|
29 |
+
"Help us expand this list! Comment and contribute to make it comprehensive so every initiative gets the visibility it deserves. Thank you!"
|
30 |
+
)
|
31 |
+
|
32 |
+
with gr.Row():
|
33 |
+
search_box = gr.Textbox(placeholder="Type to search...", label="Search")
|
34 |
+
with gr.Row():
|
35 |
+
table = gr.Dataframe(
|
36 |
+
value=df,
|
37 |
+
label="Spanish NLP Initiatives",
|
38 |
+
show_label=False,
|
39 |
+
interactive=False,
|
40 |
+
wrap=True,
|
41 |
+
column_widths=["40%", "20%", "10%", "25%", "15%"],
|
42 |
+
)
|
43 |
+
search_box.change(fn=update_table, inputs=search_box, outputs=table)
|
44 |
+
|
45 |
+
app.launch()
|
requirements.txt
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
gradio==4.26.0
|
2 |
+
pandas==2.2.1
|
spanish_nlp_initiatives.csv
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
Name, Type, Country, Language, URL
|
2 |
+
SomosNLP, non-profit, World, Mix, somosnlp.org
|