Skip to content

Commit

Permalink
🔧✨refactor: Update import paths and file paths
Browse files Browse the repository at this point in the history
Update the import paths to reflect the correct file structure in 'cli.py', 'modelamiento_topicos.py' and 'limpiar_tablas.py'. Also, adjust the file paths for loading the model and thesaurus within 'modelamiento_topicos.py' and 'limpiar_tablas.py'.
  • Loading branch information
complexluise committed Oct 25, 2024
1 parent 7546b1e commit 890bfdd
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/cli.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import click
import logging
from pathlib import Path
from limpiar_tablas import BibliotecaDataProcessor
from src.limpiar_tablas import BibliotecaDataProcessor


@click.command()
Expand Down
6 changes: 3 additions & 3 deletions src/limpiar_tablas.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
from typing import List, Dict, Union, Tuple
from dataclasses import dataclass

from modelamiento_topicos import ProcesadorMateriasEmbeddings
from extraer_vocabulario import extraer_vocabulario, Termino
from src.modelamiento_topicos import ProcesadorMateriasEmbeddings
from src.extraer_vocabulario import extraer_vocabulario


@dataclass
Expand Down Expand Up @@ -422,7 +422,7 @@ def _modelar_topicos(self, columna_tema: str = "Tema principal") -> pd.DataFrame
raise ValueError(f"La columna '{columna_tema}' no existe en el DataFrame.")

# Cargar el tesauro
with open("../raw_data/vocabulario.html", "r", encoding="utf-8") as f:
with open("./raw_data/vocabulario.html", "r", encoding="utf-8") as f:
html_content = f.read()
tesauro = extraer_vocabulario(html_content)

Expand Down
4 changes: 2 additions & 2 deletions src/modelamiento_topicos.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from sentence_transformers import SentenceTransformer
from sklearn.metrics.pairwise import cosine_similarity

from extraer_vocabulario import Termino
from src.extraer_vocabulario import Termino

logging.basicConfig(
level=logging.INFO, format="%(asctime)s - %(levelname)s - %(message)s"
Expand Down Expand Up @@ -48,7 +48,7 @@ def __init__(

@staticmethod
def cargar_o_descargar_modelo(modelo_nombre: str) -> SentenceTransformer:
modelo_path = os.path.join("../modelos", modelo_nombre)
modelo_path = os.path.join("./modelos", modelo_nombre)
if os.path.exists(modelo_path):
logging.info(f"Cargando modelo existente desde {modelo_path}")
modelo = SentenceTransformer(modelo_path, trust_remote_code=True)
Expand Down

0 comments on commit 890bfdd

Please sign in to comment.