File size: 5,527 Bytes
a5766c6 b9e7705 a5766c6 50002b2 ba8f254 50002b2 82f0232 3a53729 82f0232 50002b2 82f0232 50002b2 d1b4eba ba8f254 50002b2 ba8f254 50002b2 ad369c0 50002b2 82f0232 50002b2 82f0232 50002b2 d1b4eba 50002b2 a5766c6 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 |
import gradio as gr
import pandas as pd
df = pd.read_csv("spanish_nlp_initiatives.csv")
def make_markdown_link(url):
link = '['+str(url).replace(" ","").replace("www.","")+'](http://'+str(url).replace(" ","")+')'
return link
df[' Website'] = df.apply(lambda row: make_markdown_link(row[' Website']), axis=1)
def update_table(search_query):
if search_query == "":
return df
else:
# Filter the dataframe based on the search query
filtered_df = df[
df.apply(
lambda row: row.astype(str)
.str.contains(search_query, case=False)
.any(),
axis=1,
)
]
return filtered_df
with gr.Blocks() as app:
with gr.Tabs():
with gr.TabItem("Español"):
gr.Markdown(
"""
# 🚀 Iniciativas de PLN en español
Descubre las iniciativas impulsando el PLN en español y lenguas cooficiales en LATAM y España.
Ayúdanos a expandir esta lista. [Comenta](https://huggingface.co/spaces/somosnlp/spanish-nlp-initiatives/discussions) y contribuye para hacerla lo más completa posible y que cada iniciativa pueda tener la visibilidad que se merece. ¡Gracias!
"""
)
with gr.Accordion(label="Leer más", open=False):
gr.Markdown(
"""
En los últimos años han surgido iniciativas para impulsar el PLN en español. El objetivo de esta lista es dar a conocer estas iniciativas y facilitar la colaboración entre personas apasionadas por el PLN en diferentes lugares del mundo.
La lista no es exhaustiva y son más que bienvenidas las contribuciones vía [comentarios o PRs](https://huggingface.co/spaces/somosnlp/spanish-nlp-initiatives/discussions) o [Twitter](https://twitter.com/SomosNLP_/status/1777744175120703605).
Estructura:
- Name: Nombre de la iniciativa
- Language: Lenguas en las que se enfoca la iniciativa (LATAM = lenguas cooficiales de LATAM, ES = lenguas cooficiales de España)
- Type: Tipo de iniciativa (proyecto, evento, comunidad, asociación, empresa open-source)
- Country: Países en lo que se realiza la mayor parte de las actividades de la iniciativa
- URL: Página web de la iniciativa
"""
)
with gr.Row():
search_box = gr.Textbox(
placeholder="Buscar...",
label="Filtra la tabla",
show_label=False,
)
with gr.Row():
table = gr.Dataframe(
value=df,
label="Iniciativas de PLN en español",
show_label=False,
interactive=False,
wrap=True,
column_widths=["40%", "15%", "15%", "20%", "20%"],
datatype="markdown",
)
search_box.change(fn=update_table, inputs=search_box, outputs=table)
with gr.TabItem("English"):
gr.Markdown(
"""
# 🚀 Spanish NLP Initiatives
Discover the initiatives driving NLP advancements in Spanish and other low-resource languages spoken in LatAm and Spain.
Help us expand this list! [Comment](https://huggingface.co/spaces/somosnlp/spanish-nlp-initiatives/discussions) and contribute to make it comprehensive so every initiative gets the visibility it deserves. Thank you!
"""
)
with gr.Accordion(label="Read more", open=False):
gr.Markdown(
"""
In recent years, several initiatives have emerged to promote NLP in Spanish. The purpose of this list is to give visibility to these initiatives and to facilitate the collaboration among NLP enthusiasts in different parts of the world.
The list is not exhaustive, and contributions via [comments or PRs](https://huggingface.co/spaces/somosnlp/spanish-nlp-initiatives/discussions) are more than welcome.
Structure:
- Name: Name of the initiative
- Language: Languages the initiative focuses on (LATAM = co-official languages in LATAM, ES = co-official languages in Spain)
- Type: Type of initiative (project, event, community, association, open-source company)
- Country: Countries where most of the initiative's activities take place
- URL: Website of the initiative
"""
)
with gr.Row():
search_box = gr.Textbox(
placeholder="Type to search...", label="Search", show_label=False
)
with gr.Row():
table = gr.Dataframe(
value=df,
label="Spanish NLP Initiatives",
show_label=False,
interactive=False,
wrap=True,
column_widths=["40%", "15%", "15%", "20%", "20%"],
)
search_box.change(fn=update_table, inputs=search_box, outputs=table)
app.launch()
|