pbesa 4.0.14__tar.gz → 4.0.16__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {pbesa-4.0.14 → pbesa-4.0.16}/PKG-INFO +1 -1
- {pbesa-4.0.14 → pbesa-4.0.16}/pbesa/celulas/celula_casos.py +10 -9
- {pbesa-4.0.14 → pbesa-4.0.16}/pbesa/celulas/celula_consultas.py +11 -9
- {pbesa-4.0.14 → pbesa-4.0.16}/pbesa/celulas/celula_datos_identificables.py +7 -6
- pbesa-4.0.16/pbesa/celulas/celula_expertos.py +57 -0
- {pbesa-4.0.14 → pbesa-4.0.16}/pbesa/celulas/celula_generar_documento.py +9 -9
- {pbesa-4.0.14 → pbesa-4.0.16}/pbesa/celulas/celula_preguntas.py +8 -5
- {pbesa-4.0.14 → pbesa-4.0.16}/pbesa/celulas/celula_saludos.py +11 -8
- {pbesa-4.0.14 → pbesa-4.0.16}/pbesa/cognitive.py +251 -122
- pbesa-4.0.16/pbesa/models.py +320 -0
- {pbesa-4.0.14 → pbesa-4.0.16}/pbesa/social/collaborative_team.py +6 -0
- {pbesa-4.0.14 → pbesa-4.0.16}/pbesa/social/prompts.py +15 -30
- {pbesa-4.0.14 → pbesa-4.0.16}/pbesa.egg-info/PKG-INFO +1 -1
- {pbesa-4.0.14 → pbesa-4.0.16}/pbesa.egg-info/SOURCES.txt +1 -0
- {pbesa-4.0.14 → pbesa-4.0.16}/setup.py +1 -1
- pbesa-4.0.14/pbesa/models.py +0 -349
- {pbesa-4.0.14 → pbesa-4.0.16}/.gitignore +0 -0
- {pbesa-4.0.14 → pbesa-4.0.16}/LICENSE +0 -0
- {pbesa-4.0.14 → pbesa-4.0.16}/LICENSE.txt +0 -0
- {pbesa-4.0.14 → pbesa-4.0.16}/MANIFEST +0 -0
- {pbesa-4.0.14 → pbesa-4.0.16}/README.md +0 -0
- {pbesa-4.0.14 → pbesa-4.0.16}/examples/django/helloworld/db.sqlite3 +0 -0
- {pbesa-4.0.14 → pbesa-4.0.16}/examples/django/helloworld/helloworld/__init__.py +0 -0
- {pbesa-4.0.14 → pbesa-4.0.16}/examples/django/helloworld/helloworld/__pycache__/__init__.cpython-36.pyc +0 -0
- {pbesa-4.0.14 → pbesa-4.0.16}/examples/django/helloworld/helloworld/__pycache__/pbesa.cpython-36.pyc +0 -0
- {pbesa-4.0.14 → pbesa-4.0.16}/examples/django/helloworld/helloworld/__pycache__/settings.cpython-36.pyc +0 -0
- {pbesa-4.0.14 → pbesa-4.0.16}/examples/django/helloworld/helloworld/__pycache__/urls.cpython-36.pyc +0 -0
- {pbesa-4.0.14 → pbesa-4.0.16}/examples/django/helloworld/helloworld/__pycache__/wsgi.cpython-36.pyc +0 -0
- {pbesa-4.0.14 → pbesa-4.0.16}/examples/django/helloworld/helloworld/asgi.py +0 -0
- {pbesa-4.0.14 → pbesa-4.0.16}/examples/django/helloworld/helloworld/pbesa.py +0 -0
- {pbesa-4.0.14 → pbesa-4.0.16}/examples/django/helloworld/helloworld/settings.py +0 -0
- {pbesa-4.0.14 → pbesa-4.0.16}/examples/django/helloworld/helloworld/urls.py +0 -0
- {pbesa-4.0.14 → pbesa-4.0.16}/examples/django/helloworld/helloworld/wsgi.py +0 -0
- {pbesa-4.0.14 → pbesa-4.0.16}/examples/django/helloworld/manage.py +0 -0
- {pbesa-4.0.14 → pbesa-4.0.16}/examples/django/helloworld/translate/__init__.py +0 -0
- {pbesa-4.0.14 → pbesa-4.0.16}/examples/django/helloworld/translate/__pycache__/__init__.cpython-36.pyc +0 -0
- {pbesa-4.0.14 → pbesa-4.0.16}/examples/django/helloworld/translate/__pycache__/admin.cpython-36.pyc +0 -0
- {pbesa-4.0.14 → pbesa-4.0.16}/examples/django/helloworld/translate/__pycache__/apps.cpython-36.pyc +0 -0
- {pbesa-4.0.14 → pbesa-4.0.16}/examples/django/helloworld/translate/__pycache__/models.cpython-36.pyc +0 -0
- {pbesa-4.0.14 → pbesa-4.0.16}/examples/django/helloworld/translate/__pycache__/urls.cpython-36.pyc +0 -0
- {pbesa-4.0.14 → pbesa-4.0.16}/examples/django/helloworld/translate/__pycache__/views.cpython-36.pyc +0 -0
- {pbesa-4.0.14 → pbesa-4.0.16}/examples/django/helloworld/translate/admin.py +0 -0
- {pbesa-4.0.14 → pbesa-4.0.16}/examples/django/helloworld/translate/apps.py +0 -0
- {pbesa-4.0.14 → pbesa-4.0.16}/examples/django/helloworld/translate/mas/controller/__pycache__/translatecontroller.cpython-36.pyc +0 -0
- {pbesa-4.0.14 → pbesa-4.0.16}/examples/django/helloworld/translate/mas/controller/__pycache__/translatedelegate.cpython-36.pyc +0 -0
- {pbesa-4.0.14 → pbesa-4.0.16}/examples/django/helloworld/translate/mas/controller/__pycache__/translateresponse.cpython-36.pyc +0 -0
- {pbesa-4.0.14 → pbesa-4.0.16}/examples/django/helloworld/translate/mas/controller/translatecontroller.py +0 -0
- {pbesa-4.0.14 → pbesa-4.0.16}/examples/django/helloworld/translate/mas/controller/translatedelegate.py +0 -0
- {pbesa-4.0.14 → pbesa-4.0.16}/examples/django/helloworld/translate/mas/controller/translateresponse.py +0 -0
- {pbesa-4.0.14 → pbesa-4.0.16}/examples/django/helloworld/translate/mas/worker/__pycache__/translatetask.cpython-36.pyc +0 -0
- {pbesa-4.0.14 → pbesa-4.0.16}/examples/django/helloworld/translate/mas/worker/__pycache__/workeragent.cpython-36.pyc +0 -0
- {pbesa-4.0.14 → pbesa-4.0.16}/examples/django/helloworld/translate/mas/worker/translatetask.py +0 -0
- {pbesa-4.0.14 → pbesa-4.0.16}/examples/django/helloworld/translate/mas/worker/workeragent.py +0 -0
- {pbesa-4.0.14 → pbesa-4.0.16}/examples/django/helloworld/translate/migrations/__init__.py +0 -0
- {pbesa-4.0.14 → pbesa-4.0.16}/examples/django/helloworld/translate/migrations/__pycache__/__init__.cpython-36.pyc +0 -0
- {pbesa-4.0.14 → pbesa-4.0.16}/examples/django/helloworld/translate/models.py +0 -0
- {pbesa-4.0.14 → pbesa-4.0.16}/examples/django/helloworld/translate/tests.py +0 -0
- {pbesa-4.0.14 → pbesa-4.0.16}/examples/django/helloworld/translate/urls.py +0 -0
- {pbesa-4.0.14 → pbesa-4.0.16}/examples/django/helloworld/translate/views.py +0 -0
- {pbesa-4.0.14 → pbesa-4.0.16}/examples/remote/mas/controller/__pycache__/countercontroller.cpython-36.pyc +0 -0
- {pbesa-4.0.14 → pbesa-4.0.16}/examples/remote/mas/controller/__pycache__/counterdelegate.cpython-36.pyc +0 -0
- {pbesa-4.0.14 → pbesa-4.0.16}/examples/remote/mas/controller/__pycache__/counterresponse.cpython-36.pyc +0 -0
- {pbesa-4.0.14 → pbesa-4.0.16}/examples/remote/mas/controller/__pycache__/translatecontroller.cpython-36.pyc +0 -0
- {pbesa-4.0.14 → pbesa-4.0.16}/examples/remote/mas/controller/__pycache__/translatedelegate.cpython-36.pyc +0 -0
- {pbesa-4.0.14 → pbesa-4.0.16}/examples/remote/mas/controller/__pycache__/translateresponse.cpython-36.pyc +0 -0
- {pbesa-4.0.14 → pbesa-4.0.16}/examples/remote/mas/controller/countercontroller.py +0 -0
- {pbesa-4.0.14 → pbesa-4.0.16}/examples/remote/mas/controller/counterdelegate.py +0 -0
- {pbesa-4.0.14 → pbesa-4.0.16}/examples/remote/mas/controller/counterresponse.py +0 -0
- {pbesa-4.0.14 → pbesa-4.0.16}/examples/remote/mas/worker/__pycache__/counteragent.cpython-36.pyc +0 -0
- {pbesa-4.0.14 → pbesa-4.0.16}/examples/remote/mas/worker/__pycache__/countertask.cpython-36.pyc +0 -0
- {pbesa-4.0.14 → pbesa-4.0.16}/examples/remote/mas/worker/__pycache__/translatetask.cpython-36.pyc +0 -0
- {pbesa-4.0.14 → pbesa-4.0.16}/examples/remote/mas/worker/__pycache__/workeragent.cpython-36.pyc +0 -0
- {pbesa-4.0.14 → pbesa-4.0.16}/examples/remote/mas/worker/counteragent.py +0 -0
- {pbesa-4.0.14 → pbesa-4.0.16}/examples/remote/mas/worker/countertask.py +0 -0
- {pbesa-4.0.14 → pbesa-4.0.16}/examples/remote/remote_a.py +0 -0
- {pbesa-4.0.14 → pbesa-4.0.16}/examples/remote/remote_b.py +0 -0
- {pbesa-4.0.14 → pbesa-4.0.16}/examples/remote/remote_c.py +0 -0
- {pbesa-4.0.14 → pbesa-4.0.16}/pbesa/__init__.py +0 -0
- {pbesa-4.0.14 → pbesa-4.0.16}/pbesa/celulas/__init__.py +0 -0
- {pbesa-4.0.14 → pbesa-4.0.16}/pbesa/celulas/web.py +0 -0
- {pbesa-4.0.14 → pbesa-4.0.16}/pbesa/kernel/__init__.py +0 -0
- {pbesa-4.0.14 → pbesa-4.0.16}/pbesa/kernel/adapter.py +0 -0
- {pbesa-4.0.14 → pbesa-4.0.16}/pbesa/kernel/agent.py +0 -0
- {pbesa-4.0.14 → pbesa-4.0.16}/pbesa/kernel/io/__init__.py +0 -0
- {pbesa-4.0.14 → pbesa-4.0.16}/pbesa/kernel/io/system_file.py +0 -0
- {pbesa-4.0.14 → pbesa-4.0.16}/pbesa/kernel/io/tcp_server.py +0 -0
- {pbesa-4.0.14 → pbesa-4.0.16}/pbesa/kernel/res/__init__.py +0 -0
- {pbesa-4.0.14 → pbesa-4.0.16}/pbesa/kernel/res/__pycache__/__init__.cpython-36.pyc +0 -0
- {pbesa-4.0.14 → pbesa-4.0.16}/pbesa/kernel/res/__pycache__/__init__.cpython-37.pyc +0 -0
- {pbesa-4.0.14 → pbesa-4.0.16}/pbesa/kernel/res/__pycache__/__init__.cpython-38.pyc +0 -0
- {pbesa-4.0.14 → pbesa-4.0.16}/pbesa/kernel/res/__pycache__/__init__.cpython-39.pyc +0 -0
- {pbesa-4.0.14 → pbesa-4.0.16}/pbesa/kernel/res/conf.json +0 -0
- {pbesa-4.0.14 → pbesa-4.0.16}/pbesa/kernel/util.py +0 -0
- {pbesa-4.0.14 → pbesa-4.0.16}/pbesa/kernel/world.py +0 -0
- {pbesa-4.0.14 → pbesa-4.0.16}/pbesa/mas.py +0 -0
- {pbesa-4.0.14 → pbesa-4.0.16}/pbesa/remote/__init__.py +0 -0
- {pbesa-4.0.14 → pbesa-4.0.16}/pbesa/remote/adm_listener.py +0 -0
- {pbesa-4.0.14 → pbesa-4.0.16}/pbesa/remote/adm_listener_handler.py +0 -0
- {pbesa-4.0.14 → pbesa-4.0.16}/pbesa/remote/exceptions.py +0 -0
- {pbesa-4.0.14 → pbesa-4.0.16}/pbesa/remote/remote_adm.py +0 -0
- {pbesa-4.0.14 → pbesa-4.0.16}/pbesa/remote/remote_adm_handler.py +0 -0
- {pbesa-4.0.14 → pbesa-4.0.16}/pbesa/social/__init__.py +0 -0
- {pbesa-4.0.14 → pbesa-4.0.16}/pbesa/social/delegator.py +0 -0
- {pbesa-4.0.14 → pbesa-4.0.16}/pbesa/social/delegator_team.py +0 -0
- {pbesa-4.0.14 → pbesa-4.0.16}/pbesa/social/dialog.py +0 -0
- {pbesa-4.0.14 → pbesa-4.0.16}/pbesa/social/dispatcher_team.py +0 -0
- {pbesa-4.0.14 → pbesa-4.0.16}/pbesa/social/selected_dispatcher_team.py +0 -0
- {pbesa-4.0.14 → pbesa-4.0.16}/pbesa/social/templates.py +0 -0
- {pbesa-4.0.14 → pbesa-4.0.16}/pbesa/social/worker.py +0 -0
- {pbesa-4.0.14 → pbesa-4.0.16}/pbesa.egg-info/dependency_links.txt +0 -0
- {pbesa-4.0.14 → pbesa-4.0.16}/pbesa.egg-info/requires.txt +0 -0
- {pbesa-4.0.14 → pbesa-4.0.16}/pbesa.egg-info/top_level.txt +0 -0
- {pbesa-4.0.14 → pbesa-4.0.16}/setup.cfg +0 -0
@@ -35,10 +35,6 @@ Responde únicamente con:
|
|
35
35
|
8. "Necesito orientación sobre propiedad industrial" → NO_QUEJA_DEMANDA
|
36
36
|
|
37
37
|
---
|
38
|
-
|
39
|
-
Texto: "%s"
|
40
|
-
|
41
|
-
Clasificación:
|
42
38
|
"""
|
43
39
|
|
44
40
|
# Efectua la inferencia del modelo.
|
@@ -46,15 +42,20 @@ def derive(service, text, max_tkns=4096) -> any:
|
|
46
42
|
try:
|
47
43
|
logging.info(f"Procesando: {text}")
|
48
44
|
tmp_work_memory = []
|
49
|
-
|
50
|
-
|
45
|
+
user_prompt = """
|
46
|
+
Texto: "%s"
|
47
|
+
|
48
|
+
Clasificación:
|
49
|
+
""" % text
|
50
|
+
tmp_work_memory.append({"role": "system", "content": PROMPT})
|
51
|
+
tmp_work_memory.append({"role": "user", "content": user_prompt})
|
51
52
|
res = service.generate(tmp_work_memory, max_tokens=max_tkns)
|
52
|
-
logging.info(f"Respuesta: {res}")
|
53
|
+
logging.info(f"[Celula][Casos][Respuesta]: {res}")
|
53
54
|
if not res or res == "":
|
54
55
|
res = text
|
55
|
-
logging.warning(f"No obtener una respuesta.")
|
56
|
+
logging.warning(f"[Celula][Casos]: No obtener una respuesta.")
|
56
57
|
return res
|
57
58
|
except Exception as e:
|
58
|
-
logging.error(f"Error al procesar: {text}")
|
59
|
+
logging.error(f"[Celula][Casos]: Error al procesar: {text}")
|
59
60
|
logging.error(e)
|
60
61
|
return None
|
@@ -20,10 +20,7 @@ Responde solo con:
|
|
20
20
|
6. "Saludos" → NO_PREGUNTA
|
21
21
|
7. "Explícame cómo hacerlo" → PREGUNTA_O_SOLICITUD
|
22
22
|
8. "No tengo acceso" → NO_PREGUNTA
|
23
|
-
|
24
|
-
Texto: "%s"
|
25
|
-
|
26
|
-
Clasificación:
|
23
|
+
---
|
27
24
|
"""
|
28
25
|
|
29
26
|
# Efectua la inferencia del modelo.
|
@@ -31,15 +28,20 @@ def derive(service, text, max_tkns=4096) -> any:
|
|
31
28
|
try:
|
32
29
|
logging.info(f"Procesando: {text}")
|
33
30
|
tmp_work_memory = []
|
34
|
-
|
35
|
-
|
31
|
+
user_prompt = """
|
32
|
+
Texto: "%s"
|
33
|
+
|
34
|
+
Clasificación:
|
35
|
+
""" % text
|
36
|
+
tmp_work_memory.append({"role": "system", "content": PROMPT})
|
37
|
+
tmp_work_memory.append({"role": "user", "content": user_prompt})
|
36
38
|
res = service.generate(tmp_work_memory, max_tokens=max_tkns)
|
37
|
-
logging.info(f"Respuesta: {res}")
|
39
|
+
logging.info(f"[Celula][Consultas][Respuesta]: {res}")
|
38
40
|
if not res or res == "":
|
39
41
|
res = text
|
40
|
-
logging.warning(f"No obtener una respuesta.")
|
42
|
+
logging.warning(f"[Celula][Consultas]: No obtener una respuesta.")
|
41
43
|
return res
|
42
44
|
except Exception as e:
|
43
|
-
logging.error(f"Error al procesar: {text}")
|
45
|
+
logging.error(f"[Celula][Consultas]: Error al procesar: {text}")
|
44
46
|
logging.error(e)
|
45
47
|
return None
|
@@ -28,18 +28,19 @@ Responde únicamente con:
|
|
28
28
|
7. "¿Cuál es el procedimiento para radicar una solicitud?" → NO_CONTIENE_DATOS
|
29
29
|
|
30
30
|
---
|
31
|
-
|
32
|
-
Texto: "%s"
|
33
|
-
|
34
|
-
Clasificación:
|
35
31
|
"""
|
36
32
|
|
37
33
|
# Efectua la inferencia del modelo.
|
38
34
|
def derive(service, text, max_tkns=4096) -> any:
|
39
35
|
try:
|
40
36
|
tmp_work_memory = []
|
41
|
-
|
42
|
-
|
37
|
+
user_prompt = """
|
38
|
+
Texto: "%s"
|
39
|
+
|
40
|
+
Clasificación:
|
41
|
+
""" % text
|
42
|
+
tmp_work_memory.append({"role": "system", "content": PROMPT})
|
43
|
+
tmp_work_memory.append({"role": "user", "content": user_prompt})
|
43
44
|
res = service.generate(tmp_work_memory, max_tokens=max_tkns)
|
44
45
|
logging.info(f"Procesando: {text}")
|
45
46
|
logging.info(f"Respuesta: {res}")
|
@@ -0,0 +1,57 @@
|
|
1
|
+
import logging
|
2
|
+
|
3
|
+
PROMPT = """
|
4
|
+
Eres un clasificador de textos que determina a qué entidad o dependencia gubernamental colombiana corresponde un texto dado, basándose en la descripción de sus funciones. Tu tarea es analizar el siguiente texto y determinar la clase más apropiada.
|
5
|
+
|
6
|
+
Responde únicamente con el nombre completo de la clase o con "NO_CORRESPONDE" si el texto no se ajusta a ninguna de las clases descritas. No agregues explicaciones ni comentarios adicionales.
|
7
|
+
|
8
|
+
%s
|
9
|
+
|
10
|
+
Opciones de respuesta posibles:
|
11
|
+
|
12
|
+
DIMAR - Dirección General Marítima
|
13
|
+
DNDA - Dirección Nacional de Derecho de Autor
|
14
|
+
ICA - Instituto Colombiano Agropecuario
|
15
|
+
SFC - Superintendencia Financiera de Colombia
|
16
|
+
SIC - Superintendencia de Industria y Comercio - Competencia Desleal
|
17
|
+
SIC - Superintendencia de Industria y Comercio - Propiedad Industrial
|
18
|
+
SIC - Superintendencia de Industria y Comercio - Protección al Consumidor
|
19
|
+
Supersalud - Superintendencia Nacional de Salud - Cobertura Servicios
|
20
|
+
Supersalud - Superintendencia Nacional de Salud - Conflictos Devoluciones
|
21
|
+
Supersalud - Superintendencia Nacional de Salud - Conflicto Entidades
|
22
|
+
Supersalud - Superintendencia Nacional de Salud - Libre Elección
|
23
|
+
Supersalud - Superintendencia Nacional de Salud - Multiafiliación
|
24
|
+
Supersalud - Superintendencia Nacional de Salud - Reconocimiento Económico
|
25
|
+
Supersociedades - Superintendencia de Sociedades - Liquidación Insolvencia
|
26
|
+
Supersociedades - Superintendencia de Sociedades - Reorganización Insolvencia
|
27
|
+
Supersociedades - Superintendencia de Sociedades - Validación Judicial
|
28
|
+
Supersociedades - Superintendencia de Sociedades - Mercantiles
|
29
|
+
NO_CORRESPONDE
|
30
|
+
"""
|
31
|
+
|
32
|
+
# Efectua la inferencia del modelo.
|
33
|
+
def derive(service, text, conocimiento, max_tkns=4096) -> any:
|
34
|
+
try:
|
35
|
+
tmp_work_memory = []
|
36
|
+
prompt = PROMPT % conocimiento
|
37
|
+
tmp_work_memory.append({"role": "system", "content": prompt})
|
38
|
+
user_prompt = """
|
39
|
+
Texto: "%s"
|
40
|
+
|
41
|
+
Clasificación:
|
42
|
+
""" % text
|
43
|
+
tmp_work_memory.append({"role": "system", "content": prompt})
|
44
|
+
tmp_work_memory.append({"role": "user", "content": user_prompt})
|
45
|
+
res = service.generate(tmp_work_memory, max_tkns)
|
46
|
+
logging.info("\n")
|
47
|
+
logging.info(f"[Celula][Expertos][Text]: {text}")
|
48
|
+
logging.info(f"[Celula][Expertos][Respuesta]: {res}")
|
49
|
+
logging.info("\n")
|
50
|
+
if not res or res == "":
|
51
|
+
res = text
|
52
|
+
logging.warning(f"[Celula][Expertos]: No obtener una respuesta.")
|
53
|
+
return res
|
54
|
+
except Exception as e:
|
55
|
+
logging.error(f"[Celula][Expertos]: Error al procesar: {text}")
|
56
|
+
logging.error(e)
|
57
|
+
return None
|
@@ -16,13 +16,6 @@ Usa el siguiente formato para estructurar tu respuesta. Si hay datos que no se e
|
|
16
16
|
%s
|
17
17
|
|
18
18
|
---
|
19
|
-
|
20
|
-
TEXTO DE ENTRADA:
|
21
|
-
%s
|
22
|
-
|
23
|
-
---
|
24
|
-
|
25
|
-
DEMANDA FORMATEADA:
|
26
19
|
"""
|
27
20
|
|
28
21
|
# Efectua la inferencia del modelo.
|
@@ -30,8 +23,15 @@ def derive(service, formato, text, max_tkns=4096) -> any:
|
|
30
23
|
try:
|
31
24
|
logging.info(f"Procesando: {text}")
|
32
25
|
tmp_work_memory = []
|
33
|
-
|
34
|
-
|
26
|
+
user_prompt = """
|
27
|
+
TEXTO DE ENTRADA:
|
28
|
+
%s
|
29
|
+
---
|
30
|
+
|
31
|
+
DEMANDA FORMATEADA:
|
32
|
+
""" % text
|
33
|
+
tmp_work_memory.append({"role": "system", "content": PROMPT % formato})
|
34
|
+
tmp_work_memory.append({"role": "user", "content": user_prompt})
|
35
35
|
res = service.generate(tmp_work_memory, max_tokens=max_tkns)
|
36
36
|
logging.info(f"Respuesta: {res}")
|
37
37
|
if not res or res == "":
|
@@ -17,9 +17,7 @@ Ejemplos:
|
|
17
17
|
- "Necesito ayuda con el código" → NO_CONTIENE
|
18
18
|
- "Saludos" → NO_CONTIENE
|
19
19
|
|
20
|
-
|
21
|
-
|
22
|
-
Clasificación:
|
20
|
+
---
|
23
21
|
"""
|
24
22
|
|
25
23
|
# Efectua la inferencia del modelo.
|
@@ -27,8 +25,13 @@ def derive(service, text, max_tkns=4096) -> any:
|
|
27
25
|
try:
|
28
26
|
logging.info(f"Procesando: {text}")
|
29
27
|
tmp_work_memory = []
|
30
|
-
|
31
|
-
|
28
|
+
user_prompt = """
|
29
|
+
Texto: "%s"
|
30
|
+
|
31
|
+
Clasificación:
|
32
|
+
""" % text
|
33
|
+
tmp_work_memory.append({"role": "system", "content": PROMPT})
|
34
|
+
tmp_work_memory.append({"role": "user", "content": user_prompt})
|
32
35
|
res = service.generate(tmp_work_memory, max_tokens=max_tkns)
|
33
36
|
logging.info(f"Respuesta: {res}")
|
34
37
|
if not res or res == "":
|
@@ -17,9 +17,7 @@ Ejemplos:
|
|
17
17
|
- "Necesito ayuda con el código" → NO_SALUDO
|
18
18
|
- "Saludos" → SALUDO
|
19
19
|
|
20
|
-
|
21
|
-
|
22
|
-
Clasificación:
|
20
|
+
---
|
23
21
|
"""
|
24
22
|
|
25
23
|
# Efectua la inferencia del modelo.
|
@@ -27,15 +25,20 @@ def derive(service, text, max_tkns=4096) -> any:
|
|
27
25
|
try:
|
28
26
|
logging.info(f"Procesando: {text}")
|
29
27
|
tmp_work_memory = []
|
30
|
-
|
31
|
-
|
28
|
+
user_prompt = """
|
29
|
+
Texto: "%s"
|
30
|
+
|
31
|
+
Clasificación:
|
32
|
+
""" % text
|
33
|
+
tmp_work_memory.append({"role": "system", "content": PROMPT})
|
34
|
+
tmp_work_memory.append({"role": "user", "content": user_prompt})
|
32
35
|
res = service.generate(tmp_work_memory, max_tokens=max_tkns)
|
33
|
-
logging.info(f"Respuesta: {res}")
|
36
|
+
logging.info(f"[Celula][Saludos][Respuesta]: {res}")
|
34
37
|
if not res or res == "":
|
35
38
|
res = text
|
36
|
-
logging.warning(f"No obtener una respuesta.")
|
39
|
+
logging.warning(f"[Celula][Saludos]: No obtener una respuesta.")
|
37
40
|
return res
|
38
41
|
except Exception as e:
|
39
|
-
logging.error(f"Error al procesar: {text}")
|
42
|
+
logging.error(f"[Celula][Saludos]: Error al procesar: {text}")
|
40
43
|
logging.error(e)
|
41
44
|
return None
|