Spaces:
Sleeping
Sleeping
app modified idioma
Browse files
app.py
CHANGED
@@ -548,12 +548,13 @@ def procesar(texto,archivo, etiquetas):
|
|
548 |
df=pd.read_csv(archivo.name,delimiter=",",encoding='utf-8')
|
549 |
|
550 |
df_new = pd.DataFrame( columns=df.columns.values)
|
551 |
-
|
552 |
-
|
553 |
for item in df.columns.values:
|
554 |
sentences=df[item]
|
555 |
#model.identificacion_idioma(sentences[0])
|
556 |
-
|
|
|
557 |
ides, predicted = modelo.aplicar_modelo(sentences,model.idioma,etiquetas)
|
558 |
|
559 |
if model.idioma=="es":
|
@@ -578,11 +579,11 @@ def procesar(texto,archivo, etiquetas):
|
|
578 |
sentences=df[item]
|
579 |
|
580 |
ides, predicted = modelo.aplicar_modelo(sentences,"en",etiquetas)
|
581 |
-
out=modelo.salida_texto2( ides,predicted)#tokens,labels
|
582 |
print('out:',out)
|
583 |
df_new[item] = modelo.unir_array(out)
|
584 |
-
|
585 |
-
|
586 |
|
587 |
#return "", df, df.to_csv(sep='\t', encoding='utf-8',index=False)
|
588 |
return "", df_new, df_new.to_csv(sep='\t', encoding='utf-8',index=False)
|
|
|
548 |
df=pd.read_csv(archivo.name,delimiter=",",encoding='utf-8')
|
549 |
|
550 |
df_new = pd.DataFrame( columns=df.columns.values)
|
551 |
+
model.identificacion_idioma(df[0][0])
|
552 |
+
modelo.idioma=model.idioma
|
553 |
for item in df.columns.values:
|
554 |
sentences=df[item]
|
555 |
#model.identificacion_idioma(sentences[0])
|
556 |
+
|
557 |
+
|
558 |
ides, predicted = modelo.aplicar_modelo(sentences,model.idioma,etiquetas)
|
559 |
|
560 |
if model.idioma=="es":
|
|
|
579 |
sentences=df[item]
|
580 |
|
581 |
ides, predicted = modelo.aplicar_modelo(sentences,"en",etiquetas)
|
582 |
+
out=modelo.salida_texto2( ides,predicted,etiquetas)#tokens,labels
|
583 |
print('out:',out)
|
584 |
df_new[item] = modelo.unir_array(out)
|
585 |
+
|
586 |
+
|
587 |
|
588 |
#return "", df, df.to_csv(sep='\t', encoding='utf-8',index=False)
|
589 |
return "", df_new, df_new.to_csv(sep='\t', encoding='utf-8',index=False)
|