Skip to content

Commit

Permalink
Merge pull request #23 from science-engineering-art/develop
Browse files Browse the repository at this point in the history
v1.0
  • Loading branch information
lead8000 authored Dec 22, 2022
2 parents 9e189e2 + 24607c4 commit 153a049
Show file tree
Hide file tree
Showing 111 changed files with 4,108 additions and 462 deletions.
21 changes: 21 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,27 @@
__pycache__/
*.py[cod]
*$py.class
proof.py

# databases
src\ddb_storage\

#node_modules
src\node_modules\


#storage
/src/ddb_storage
/ddb_storage

# C extensions
*.so

irs_vs/
src/tmp.py
.vscode/
ddb_storage/

# Distribution / packaging
.Python
build/
Expand Down Expand Up @@ -127,3 +144,7 @@ dmypy.json

# Pyre type checker
.pyre/
src/ddb_storage/cranfield_FuzyModelPrecalculus.json
src/ddb_storage/vaswani_FuzyModelPrecalculus.json
docs/Marcos_part/Proyecto_Final_Sherlock_marcos_part.pdf
docs/Marcos_part/Proyecto_Final_Sherlock_marcos_part.pdf
13 changes: 11 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@

install:
pip install -r src/backend/requirements.txt; cd src/frontend; npm install

python:
cd src; python -m uvicorn main:app --reload
cd src/backend; uvicorn main:app --reload

react:
cd src/client; npm start
cd src/frontend; npm start

run-docker:
cd src/backend; docker run -d --rm --name sherlock-back -p 8000:8000 sherlock-back; cd ../frontend; docker run -d --rm --name sherlock-front -p 3000:3000 sherlock-front

stop-docker:
docker rmi sherlock-back; docker rmi sherlock-front
30 changes: 8 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,12 @@

## Installation

### Python

```shell
pip install fastapi
pip install "uvicorn[standard]"
pip install unidecode
pip install ir_datasets
```

### React

```shell
cd src/client
npm install
make install
```

## Execution

### Linux

From the root directory run in a terminal,

```shell
Expand All @@ -34,20 +20,20 @@ and run this in another terminal.
make react
```

### Windows
## Docker

From the root directory run in a terminal,
You may not want to conflict with packages installed on your local computer, you can more easily build the docker image and run it with a container.

From the root directory runs from a terminal to lift the service,

```shell
cd src
uvicorn main:app --reload
make run-docker
```

Also run this in another terminal.
and to close the service.

```shell
cd src/client
npm start
make stop-docker
```

Finally, enter the browser at the following web address [localhost:3000](http://localhost:3000).
15 changes: 15 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
version: '3.9'

services:

sherlock-back:
build: ./src
ports:
- "8000:8000"

sherlock-front:
build: ./src/client
ports:
- "3000:3000"
depends_on:
- sherlock-back
Binary file modified docs/Preentrega_Proyecto_Final_SRI.pdf
Binary file not shown.
Binary file added docs/Proyecto_Final_SRI_Sherlock.pdf
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
\relax
\providecommand\babel@aux[2]{}
\@nameuse{bbl@beforestart}
\catcode `"\active
\catcode `<\active
\catcode `>\active
\catcode`"\active
\catcode`<\active
\catcode`>\active
\@nameuse{es@quoting}
\babel@aux{spanish}{}
\select@language{spanish}
\@writefile{toc}{\select@language{spanish}}
\@writefile{lof}{\select@language{spanish}}
\@writefile{lot}{\select@language{spanish}}
\citation{B3}
\citation{B4}
\@writefile{toc}{\contentsline {section}{\numberline {1}Introducci\'on}{1}{}\protected@file@percent }
\@writefile{toc}{\contentsline {section}{\numberline {2}Modelaci\'on del problema}{1}{}\protected@file@percent }
\@writefile{toc}{\contentsline {subsection}{\numberline {2.1}Documentos}{1}{}\protected@file@percent }
\@writefile{toc}{\contentsline {subsection}{\numberline {2.2}Normalizaci\'on de un t\'ermino}{1}{}\protected@file@percent }
\@writefile{toc}{\contentsline {subsection}{\numberline {2.3}Corpus}{1}{}\protected@file@percent }
\@writefile{toc}{\contentsline {section}{\numberline {1}Introducci\'on}{1}}
\@writefile{toc}{\contentsline {section}{\numberline {2}Modelaci\'on del problema}{1}}
\@writefile{toc}{\contentsline {subsection}{\numberline {2.1}Documentos}{1}}
\@writefile{toc}{\contentsline {subsection}{\numberline {2.2}Normalizaci\'on de un t\'ermino}{1}}
\@writefile{toc}{\contentsline {subsection}{\numberline {2.3}Corpus}{1}}
\citation{B1}
\citation{B1}
\citation{B2}
Expand All @@ -23,9 +24,8 @@
\bibcite{B2}{2}
\bibcite{B3}{3}
\bibcite{B4}{4}
\@writefile{toc}{\contentsline {subsection}{\numberline {2.4}Modelo base}{2}{}\protected@file@percent }
\@writefile{toc}{\contentsline {section}{\numberline {3}Modelo vectorial}{2}{}\protected@file@percent }
\@writefile{toc}{\contentsline {subsection}{\numberline {3.1}Preprocesamiento}{2}{}\protected@file@percent }
\@writefile{toc}{\contentsline {subsection}{\numberline {3.2}Recuperación de documentos}{2}{}\protected@file@percent }
\@writefile{toc}{\contentsline {section}{\numberline {4}Conclusiones}{2}{}\protected@file@percent }
\gdef \@abspage@last{6}
\@writefile{toc}{\contentsline {subsection}{\numberline {2.4}Modelo base}{2}}
\@writefile{toc}{\contentsline {section}{\numberline {3}Modelo vectorial}{2}}
\@writefile{toc}{\contentsline {subsection}{\numberline {3.1}Preprocesamiento}{2}}
\@writefile{toc}{\contentsline {subsection}{\numberline {3.2}Recuperaci\IeC {\'o}n de documentos}{2}}
\@writefile{toc}{\contentsline {section}{\numberline {4}Conclusiones}{2}}
Binary file not shown.
File renamed without changes.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
% the LaTeX2e class from Springer-Verlag
% for Lecture Notes in Computer Science, version 2.4
\documentclass{llncs}
\usepackage{llncsdoc}
\usepackage{Preentrega_Proyecto_Final_SRI}
\usepackage{color}

\usepackage[utf8]{inputenc}
\usepackage{algorithm}
\usepackage{amsfonts}
\usepackage{todonotes}
Expand Down Expand Up @@ -82,7 +83,7 @@
\section{Modelaci\'on del problema}

\subsection{Documentos}
Para el desarrollo de nuestro Sistema de Recuperaci\'on de la Informaci\'on modelamos un documento como un objeto que contiene al menos dos propiedades, un \texttt{doc\_id} que identifica de manera \'unica a un documento dentro del conjunto de documentos del dataset en cuesti\'on; y un \texttt{text} que corresponde con el texto de este. Tambi\'en puede tener otras propiedades, por ejemplo: \texttt{title}, \texttt{author}; pero eso depende de la riqueza del dataset que provee el paquete de Python \texttt{ir\_datasets} (ver \cite{B3}).
Para el desarrollo de este Sistema de Recuperaci\'on de la Informaci\'on modelamos un documento como un objeto que contiene al menos dos propiedades, un \texttt{doc\_id} que identifica de manera \'unica a un documento dentro del conjunto de documentos del dataset en cuesti\'on; y un \texttt{text} que corresponde con el texto de este. Tambi\'en puede tener otras propiedades, por ejemplo: \texttt{title}, \texttt{author}; pero eso depende de la riqueza del dataset que provee el paquete de Python \texttt{ir\_datasets} (ver \cite{B3}).

Como el texto de un documento es inc\'omodo de manipular por venir en forma de \texttt{string}, este se toqueniza y convierte en una lista de t\'erminos indexados normalizados. Esto se logra haciendo uso del paquete de Python \texttt{re} (referirse a \cite{B4}) que proporciona una colecci\'on de funciones que facilitan el trabajo con expresiones regulares.

Expand Down
11 changes: 11 additions & 0 deletions docs/pre-submission/Preentrega_Proyecto_Final_SRI.toc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
\select@language {spanish}
\contentsline {section}{\numberline {1}Introducci\'on}{1}
\contentsline {section}{\numberline {2}Modelaci\'on del problema}{1}
\contentsline {subsection}{\numberline {2.1}Documentos}{1}
\contentsline {subsection}{\numberline {2.2}Normalizaci\'on de un t\'ermino}{1}
\contentsline {subsection}{\numberline {2.3}Corpus}{1}
\contentsline {subsection}{\numberline {2.4}Modelo base}{2}
\contentsline {section}{\numberline {3}Modelo vectorial}{2}
\contentsline {subsection}{\numberline {3.1}Preprocesamiento}{2}
\contentsline {subsection}{\numberline {3.2}Recuperaci\IeC {\'o}n de documentos}{2}
\contentsline {section}{\numberline {4}Conclusiones}{2}
4 changes: 2 additions & 2 deletions docs/pre-submission/eijkel2.eps

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file removed docs/pre-submission/llncsdoc.pdf
Binary file not shown.
Binary file removed docs/pre-submission/llncsdoc.synctex.gz
Binary file not shown.
11 changes: 0 additions & 11 deletions docs/pre-submission/llncsdoc.toc

This file was deleted.

Binary file added docs/report/PR_plot(all).png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/report/PR_plot(k=300).png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
69 changes: 69 additions & 0 deletions docs/report/Proyecto_Final_Sherlock.aux
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
\relax
\providecommand\babel@aux[2]{}
\@nameuse{bbl@beforestart}
\catcode `"\active
\catcode `<\active
\catcode `>\active
\@nameuse{es@quoting}
\babel@aux{english}{}
\babel@aux{spanish}{}
\babel@aux{english}{}
\babel@aux{spanish}{}
\citation{B4}
\@writefile{toc}{\contentsline {section}{\numberline {1}Introducci\'on}{1}{}\protected@file@percent }
\@writefile{toc}{\contentsline {section}{\numberline {2}Dise\~no del sistema}{1}{}\protected@file@percent }
\@writefile{toc}{\contentsline {subsection}{\numberline {2.1}Documentos}{1}{}\protected@file@percent }
\citation{B7}
\citation{B2}
\citation{B2}
\@writefile{toc}{\contentsline {subsection}{\numberline {2.2}Normalizaci\'on de un t\'ermino}{2}{}\protected@file@percent }
\@writefile{toc}{\contentsline {subsection}{\numberline {2.3}Corpus}{2}{}\protected@file@percent }
\@writefile{toc}{\contentsline {subsection}{\numberline {2.4}Modelo base}{2}{}\protected@file@percent }
\@writefile{toc}{\contentsline {section}{\numberline {3}Modelo Booleano}{2}{}\protected@file@percent }
\@writefile{toc}{\contentsline {subsection}{\numberline {3.1}Descripci\'on del modelo}{3}{}\protected@file@percent }
\@writefile{toc}{\contentsline {subsection}{\numberline {3.2}Implementaci\'on}{3}{}\protected@file@percent }
\@writefile{toc}{\contentsline {section}{\numberline {4}Modelo Vectorial}{3}{}\protected@file@percent }
\@writefile{toc}{\contentsline {subsubsection}{TF}{4}{}\protected@file@percent }
\@writefile{toc}{\contentsline {subsubsection}{IDF}{4}{}\protected@file@percent }
\citation{B1}
\citation{B1}
\citation{B1}
\citation{B2}
\citation{B2}
\citation{B2}
\citation{B1}
\@writefile{toc}{\contentsline {subsubsection}{Similitud del coseno}{5}{}\protected@file@percent }
\@writefile{toc}{\contentsline {subsection}{\numberline {4.1}Implementación}{5}{}\protected@file@percent }
\@writefile{toc}{\contentsline {subsubsection}{Preprocesamiento}{5}{}\protected@file@percent }
\@writefile{toc}{\contentsline {subsubsection}{Recuperación de documentos}{5}{}\protected@file@percent }
\citation{B1}
\citation{B2}
\@writefile{toc}{\contentsline {subsection}{\numberline {4.2}Retroalimentaci\'on}{6}{}\protected@file@percent }
\@writefile{toc}{\contentsline {subsubsection}{Algoritmo de Rocchio}{6}{}\protected@file@percent }
\@writefile{toc}{\contentsline {section}{\numberline {5}Modelo Fuzzy}{6}{}\protected@file@percent }
\citation{B2}
\citation{B5}
\newlabel{def2}{{3}{7}}
\@writefile{toc}{\contentsline {subsection}{\numberline {5.1}Descripci\'on del modelo usado}{7}{}\protected@file@percent }
\@writefile{toc}{\contentsline {subsection}{\numberline {5.2}Implementaci\'on.}{8}{}\protected@file@percent }
\@writefile{toc}{\contentsline {section}{\numberline {6}Evaluaci\'on de los modelos}{8}{}\protected@file@percent }
\citation{B1}
\@writefile{toc}{\contentsline {subsection}{\numberline {6.1}Modelo Booleano}{9}{}\protected@file@percent }
\@writefile{toc}{\contentsline {subsection}{\numberline {6.2}Modelo Vectorial}{10}{}\protected@file@percent }
\citation{B2}
\@writefile{toc}{\contentsline {subsection}{\numberline {6.3}Modelo Fuzzy}{11}{}\protected@file@percent }
\citation{B6}
\citation{B1}
\@writefile{toc}{\contentsline {section}{\numberline {7}Agrupamiento}{12}{}\protected@file@percent }
\@writefile{toc}{\contentsline {subsection}{\numberline {7.1}K-means}{13}{}\protected@file@percent }
\@writefile{toc}{\contentsline {subsection}{\numberline {7.2}Objetivo perseguido}{13}{}\protected@file@percent }
\@writefile{toc}{\contentsline {subsection}{\numberline {7.3}Implementaci\'on}{13}{}\protected@file@percent }
\@writefile{toc}{\contentsline {subsection}{\numberline {7.4}Resultados}{14}{}\protected@file@percent }
\bibcite{B1}{1}
\bibcite{B2}{2}
\bibcite{B3}{3}
\bibcite{B4}{4}
\bibcite{B5}{5}
\bibcite{B6}{6}
\@writefile{toc}{\contentsline {section}{\numberline {8}Conclusiones y trabajo futuro}{15}{}\protected@file@percent }
\gdef \@abspage@last{18}
Binary file added docs/report/Proyecto_Final_Sherlock.gz
Binary file not shown.
Binary file added docs/report/Proyecto_Final_Sherlock.pdf
Binary file not shown.
42 changes: 42 additions & 0 deletions docs/report/Proyecto_Final_Sherlock.sty
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
% This is LLNCSDOC.STY the modification of the
% LLNCS class file for the documentation of
% the class itself.
%
\def\AmS{{\protect\usefont{OMS}{cmsy}{m}{n}%
A\kern-.1667em\lower.5ex\hbox{M}\kern-.125emS}}
\def\AmSTeX{{\protect\AmS-\protect\TeX}}
%
\def\ps@myheadings{\let\@mkboth\@gobbletwo
\def\@oddhead{\hbox{}\hfil\small\rm\rightmark
\qquad\thepage}%
\def\@oddfoot{}\def\@evenhead{\small\rm\thepage\qquad
\leftmark\hfil}%
\def\@evenfoot{}\def\sectionmark##1{}\def\subsectionmark##1{}}
\ps@myheadings
%
\setcounter{tocdepth}{2}
%
\renewcommand{\labelitemi}{--}
\newenvironment{alpherate}%
{\renewcommand{\labelenumi}{\alph{enumi})}\begin{enumerate}}%
{\end{enumerate}\renewcommand{\labelenumi}{enumi}}
%
\def\bibauthoryear{\begingroup
\def\thebibliography##1{\section*{References}%
\small\list{}{\settowidth\labelwidth{}\leftmargin\parindent
\itemindent=-\parindent
\labelsep=\z@
\usecounter{enumi}}%
\def\newblock{\hskip .11em plus .33em minus -.07em}%
\sloppy
\sfcode`\.=1000\relax}%
\def\@cite##1{##1}%
\def\@lbibitem[##1]##2{\item[]\if@filesw
{\def\protect####1{\string ####1\space}\immediate
\write\@auxout{\string\bibcite{##2}{##1}}}\fi\ignorespaces}%
\begin{thebibliography}{}
\bibitem[1982]{clar:eke3} Clarke, F., Ekeland, I.: Nonlinear
oscillations and boundary-value problems for Hamiltonian systems.
Arch. Rat. Mech. Anal. 78, 315--333 (1982)
\end{thebibliography}
\endgroup}
Binary file added docs/report/Proyecto_Final_Sherlock.synctex.gz
Binary file not shown.
Loading

0 comments on commit 153a049

Please sign in to comment.