Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Lacoin Achille
PAO_Semestre7
Commits
18e0e913
Commit
18e0e913
authored
Jan 08, 2019
by
Enjalbert Quentin
Browse files
Creation package + interface
parent
04e2fa54
Changes
13
Hide whitespace changes
Inline
Side-by-side
src/clustering/__init__.py
0 → 100644
View file @
18e0e913
__all__
=
[
"interface"
]
\ No newline at end of file
src/arbre_binaire.py
→
src/
clustering/
arbre_binaire.py
View file @
18e0e913
File moved
src/cha.py
→
src/
clustering/
cha.py
View file @
18e0e913
from
typing
import
List
,
Tuple
from
arbre_binaire
import
ArbreBinaire
from
reseau
import
Reseau
from
.
arbre_binaire
import
ArbreBinaire
from
.
reseau
import
Reseau
def
cha
(
reseau
:
Reseau
,
type_distance
:
str
=
"min"
):
...
...
src/demo_jupyter.py
→
src/
clustering/
demo_jupyter.py
View file @
18e0e913
#%%
from
make_clusters
import
creer_reseau
import
cha
from
.
make_clusters
import
creer_reseau
from
.
import
cha
#%%
reseauEn
=
creer_reseau
(
"out/scoreAllEn.csv"
)
...
...
src/get_scores.py
→
src/
clustering/
get_scores.py
View file @
18e0e913
...
...
@@ -55,7 +55,8 @@ def calculate_scoreNormalise(src: str, out: str):
if
__name__
==
"__main__"
:
calculate_score
(
"./data/listeMotsHaptiques.csv"
,
"./
data
/scoreAllEn.csv"
,
"En"
)
calculate_score
(
"./data/listeMotsHaptiques.csv"
,
"./
out
/scoreAllEn.csv"
,
"En"
)
Lesk
.
setLang
(
"fra"
)
calculate_score
(
"./data/listeMotsHaptiques.csv"
,
"out/scoreAllFr.csv"
,
"Fr"
)
# calculate_scoreNormalise("./data/scoreAllEn.csv","./data/scoreAllEnNormalise.csv")
calculate_score
(
"./data/listeMotsHaptiques.csv"
,
"./out/scoreAllFr.csv"
,
"Fr"
)
calculate_scoreNormalise
(
"./out/scoreAllEn.csv"
,
"./out/scoreAllEnNormalise.csv"
)
calculate_scoreNormalise
(
"./out/scoreAllFr.csv"
,
"./out/scoreAllFrNormalise.csv"
)
src/clustering/interface.py
0 → 100644
View file @
18e0e913
from
.
import
make_clusters
from
.
import
cha
from
.reseau
import
Reseau
from
.arbre_binaire
import
ArbreBinaire
def
creer_reseau
(
src
:
str
)
->
Reseau
:
return
make_clusters
.
creer_reseau
(
src
)
def
cha
(
reseau
:
Reseau
,
type_distance
:
str
=
"min"
):
return
cha
.
cha
(
reseau
,
type_distance
)
def
decouper_clusters
(
cluster_racine
:
ArbreBinaire
,
nb_clusters
:
int
):
return
cha
.
decouper_clusters
(
cluster_racine
,
nb_clusters
)
def
clusters_to_string
(
liste_clusters
):
return
cha
.
clusters_to_string
(
liste_clusters
)
\ No newline at end of file
src/lesk.py
→
src/
clustering/
lesk.py
View file @
18e0e913
File moved
src/make_clusters.py
→
src/
clustering/
make_clusters.py
View file @
18e0e913
...
...
@@ -4,8 +4,8 @@ import numpy as np
from
scipy.cluster.hierarchy
import
dendrogram
,
linkage
from
scipy.spatial.distance
import
squareform
from
matplotlib
import
pyplot
as
plt
from
reseau
import
Reseau
from
cha
import
cha
,
decouper_clusters
from
.
reseau
import
Reseau
from
.
cha
import
cha
,
decouper_clusters
def
creer_reseau
(
src
:
str
)
->
Reseau
:
...
...
src/noeud.py
→
src/
clustering/
noeud.py
View file @
18e0e913
File moved
src/reseau.py
→
src/
clustering/
reseau.py
View file @
18e0e913
from
noeud
import
Noeud
from
.
noeud
import
Noeud
from
typing
import
List
,
Tuple
,
Dict
...
...
src/clustering/test/__init__.py
0 → 100644
View file @
18e0e913
src/test_Lesk.py
→
src/
clustering/test/
test_Lesk.py
View file @
18e0e913
from
lesk
import
Lesk
from
..
lesk
import
Lesk
from
nltk.corpus
import
wordnet
import
pytest
...
...
src/serveur.py
View file @
18e0e913
...
...
@@ -4,8 +4,7 @@ from flask import Flask, jsonify
from
flask_restful
import
Api
,
Resource
,
reqparse
from
flask_cors
import
CORS
from
make_clusters
import
creer_reseau
from
cha
import
cha
,
decouper_clusters
,
clusters_to_string
from
clustering.interface
import
creer_reseau
,
cha
,
decouper_clusters
,
clusters_to_string
reseauEn
=
creer_reseau
(
"../out/scoreAllEn.csv"
)
reseauFr
=
creer_reseau
(
"../out/scoreAllFr.csv"
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment