Spaces:
Sleeping
Sleeping
app modified output idioma
Browse files
app.py
CHANGED
@@ -67,7 +67,7 @@ class Model:
|
|
67 |
new_tokens=[]
|
68 |
ig_tokens=[] #ignorar estos indices del array de indentificadores
|
69 |
for token in tokens:
|
70 |
-
|
71 |
ind=len(new_tokens)
|
72 |
if i<len(tokens):
|
73 |
if token.startswith(caracter):
|
@@ -236,6 +236,7 @@ class Model:
|
|
236 |
out2 = self.salida_texto(new_tokens,new_identificadores)#solo identificadores
|
237 |
else:
|
238 |
out2 = self.salida_texto(new_tokens,self.reemplazo_fake(new_identificadores))
|
|
|
239 |
|
240 |
return (
|
241 |
|
@@ -538,7 +539,7 @@ def procesar(texto,archivo, etiquetas):
|
|
538 |
print('out es:',out)
|
539 |
df_new[item] = modelo.unir_array(out)
|
540 |
|
541 |
-
return "", df_new, df_new.to_csv(sep='\t', encoding='utf-8',index=False)
|
542 |
#return "", df_new, df_new.to_excel( index=False)
|
543 |
else:
|
544 |
print('json')
|
@@ -564,7 +565,7 @@ def procesar(texto,archivo, etiquetas):
|
|
564 |
#return "", df, df.to_csv(sep='\t', encoding='utf-8',index=False)
|
565 |
return "", df_new, df_new.to_csv(sep='\t', encoding='utf-8',index=False)
|
566 |
|
567 |
-
demo = gr.Interface(fn=procesar,inputs=["text",gr.File(), "checkbox"] , outputs=["text",gr.Dataframe(
|
568 |
#
|
569 |
demo.launch(share=True)
|
570 |
|
|
|
67 |
new_tokens=[]
|
68 |
ig_tokens=[] #ignorar estos indices del array de indentificadores
|
69 |
for token in tokens:
|
70 |
+
print('token_texto:',token,caracter)
|
71 |
ind=len(new_tokens)
|
72 |
if i<len(tokens):
|
73 |
if token.startswith(caracter):
|
|
|
236 |
out2 = self.salida_texto(new_tokens,new_identificadores)#solo identificadores
|
237 |
else:
|
238 |
out2 = self.salida_texto(new_tokens,self.reemplazo_fake(new_identificadores))
|
239 |
+
|
240 |
|
241 |
return (
|
242 |
|
|
|
539 |
print('out es:',out)
|
540 |
df_new[item] = modelo.unir_array(out)
|
541 |
|
542 |
+
return "", df_new, df_new.to_csv(sep='\t', encoding='utf-8',index=False)
|
543 |
#return "", df_new, df_new.to_excel( index=False)
|
544 |
else:
|
545 |
print('json')
|
|
|
565 |
#return "", df, df.to_csv(sep='\t', encoding='utf-8',index=False)
|
566 |
return "", df_new, df_new.to_csv(sep='\t', encoding='utf-8',index=False)
|
567 |
|
568 |
+
demo = gr.Interface(fn=procesar,inputs=["text",gr.File(), "checkbox"] , outputs=["text",gr.Dataframe(interactive=False),"text"])
|
569 |
#
|
570 |
demo.launch(share=True)
|
571 |
|