Spaces:
Sleeping
Sleeping
COULIBALY BOURAHIMA
commited on
Commit
·
39149ca
1
Parent(s):
2789115
similarité
Browse files- .gcloudignore +0 -19
- Dockerfile → App/brouillon/Dockerfile +0 -0
- main.py → App/brouillon/main.py +0 -0
- App/class_input_box/__pycache__/input_box.cpython-311.pyc +0 -0
- App/utils/__pycache__/divers_function.cpython-311.pyc +0 -0
- App/utils/dataset/Normalisation - dictionnaire.tsv +146 -0
- App/utils/divers_function.py +23 -1
- app.py +10 -11
- Carrefour_logo.png → images/Carrefour_logo.png +0 -0
- logo.png → images/logo.png +0 -0
- query +0 -1
- start +0 -1
- stop +0 -1
.gcloudignore
DELETED
|
@@ -1,19 +0,0 @@
|
|
| 1 |
-
# This file specifies files that are *not* uploaded to Google Cloud
|
| 2 |
-
# using gcloud. It follows the same syntax as .gitignore, with the addition of
|
| 3 |
-
# "#!include" directives (which insert the entries of the given .gitignore-style
|
| 4 |
-
# file at that point).
|
| 5 |
-
#
|
| 6 |
-
# For more information, run:
|
| 7 |
-
# $ gcloud topic gcloudignore
|
| 8 |
-
#
|
| 9 |
-
.gcloudignore
|
| 10 |
-
# If you would like to upload your .git directory, .gitignore file or files
|
| 11 |
-
# from your .gitignore file, remove the corresponding line
|
| 12 |
-
# below:
|
| 13 |
-
.git
|
| 14 |
-
.gitignore
|
| 15 |
-
|
| 16 |
-
# Python pycache:
|
| 17 |
-
__pycache__/
|
| 18 |
-
# Ignored by the build system
|
| 19 |
-
/setup.cfg
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Dockerfile → App/brouillon/Dockerfile
RENAMED
|
File without changes
|
main.py → App/brouillon/main.py
RENAMED
|
File without changes
|
App/class_input_box/__pycache__/input_box.cpython-311.pyc
CHANGED
|
Binary files a/App/class_input_box/__pycache__/input_box.cpython-311.pyc and b/App/class_input_box/__pycache__/input_box.cpython-311.pyc differ
|
|
|
App/utils/__pycache__/divers_function.cpython-311.pyc
CHANGED
|
Binary files a/App/utils/__pycache__/divers_function.cpython-311.pyc and b/App/utils/__pycache__/divers_function.cpython-311.pyc differ
|
|
|
App/utils/dataset/Normalisation - dictionnaire.tsv
ADDED
|
@@ -0,0 +1,146 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
ABBREVIATIONS CORRESPONDANCES
|
| 2 |
+
dissolv dissolvant
|
| 3 |
+
diss dissolvant
|
| 4 |
+
masc mascara
|
| 5 |
+
mlvernis ml vernis
|
| 6 |
+
ong ongle
|
| 7 |
+
soi soins
|
| 8 |
+
bjs bourjois 10ML BL CERNES AL FAB 200 BJS BOURJOIS COTY
|
| 9 |
+
pdr poudre
|
| 10 |
+
plm plm 10G PLM 04JAUN.TRANS.BO.GR.BIO
|
| 11 |
+
poud poudre
|
| 12 |
+
bg bg 1.6G CRAYON YEUX 06NOIS BG BIO
|
| 13 |
+
yx yeux
|
| 14 |
+
eye yeux
|
| 15 |
+
y yeux
|
| 16 |
+
cra crayon
|
| 17 |
+
cr crème
|
| 18 |
+
cray crayon
|
| 19 |
+
ess essentiel
|
| 20 |
+
leg legume
|
| 21 |
+
ver vert
|
| 22 |
+
vrt vert
|
| 23 |
+
bio biologique
|
| 24 |
+
lsirop l sirop
|
| 25 |
+
spec special
|
| 26 |
+
cdp compagnie de province
|
| 27 |
+
demaq demaquillant
|
| 28 |
+
trse trousse
|
| 29 |
+
eaa eucerin anti age
|
| 30 |
+
eaf eafit
|
| 31 |
+
epil epilation
|
| 32 |
+
veg vegetale
|
| 33 |
+
pfum parfum
|
| 34 |
+
gaill gaillac
|
| 35 |
+
juranc jurancon
|
| 36 |
+
bor bordeaux
|
| 37 |
+
bord bordeaux
|
| 38 |
+
hle huile
|
| 39 |
+
aoc appelation d'origine contrôlée
|
| 40 |
+
aop appelation d'origine protégée
|
| 41 |
+
rg rouge
|
| 42 |
+
rges rouge
|
| 43 |
+
rge rouge
|
| 44 |
+
rse rose
|
| 45 |
+
rs rose
|
| 46 |
+
bl blanc
|
| 47 |
+
bdx Bordeaux
|
| 48 |
+
vdt vin de table
|
| 49 |
+
vdp vin de pays
|
| 50 |
+
blc blanc
|
| 51 |
+
bib bag in box
|
| 52 |
+
citr citron
|
| 53 |
+
co coco
|
| 54 |
+
gourm gourmand
|
| 55 |
+
patis patisserie
|
| 56 |
+
p'tits petit
|
| 57 |
+
p'tit petit
|
| 58 |
+
p tit petit
|
| 59 |
+
pt pepite
|
| 60 |
+
rev revil
|
| 61 |
+
succ sucettes
|
| 62 |
+
succet sucettes
|
| 63 |
+
chocohouse choco house
|
| 64 |
+
sach sachet
|
| 65 |
+
choc chocolat
|
| 66 |
+
tab tablette
|
| 67 |
+
hte haute
|
| 68 |
+
spagh spaghetti
|
| 69 |
+
scht sachet
|
| 70 |
+
nr noir
|
| 71 |
+
caf cafe
|
| 72 |
+
barr barre
|
| 73 |
+
pces pieces
|
| 74 |
+
pc pieces
|
| 75 |
+
acidu acidule
|
| 76 |
+
blnc blanc
|
| 77 |
+
frui fruit
|
| 78 |
+
gourman gourmand
|
| 79 |
+
bte boîte
|
| 80 |
+
bt boîte
|
| 81 |
+
ptit petit
|
| 82 |
+
corb corbeil
|
| 83 |
+
ptits petit
|
| 84 |
+
pti petit
|
| 85 |
+
nois noisette
|
| 86 |
+
poul poulain
|
| 87 |
+
barq barquette
|
| 88 |
+
barqu barquette
|
| 89 |
+
fizz fizzy
|
| 90 |
+
st saint
|
| 91 |
+
mich michel
|
| 92 |
+
cal calendrier
|
| 93 |
+
calend calendrier
|
| 94 |
+
calendr calendrier
|
| 95 |
+
caram caramel
|
| 96 |
+
cava cavalier
|
| 97 |
+
har haribo
|
| 98 |
+
choco chocolat
|
| 99 |
+
lt lait
|
| 100 |
+
choc'n chocolat noir
|
| 101 |
+
choc n chocolat noir
|
| 102 |
+
degust degustation
|
| 103 |
+
degus degustation
|
| 104 |
+
bis biscuit
|
| 105 |
+
coffr coffret
|
| 106 |
+
coff coffret
|
| 107 |
+
cof coffet
|
| 108 |
+
conf confiserie
|
| 109 |
+
confis confiserie
|
| 110 |
+
croco crocodile
|
| 111 |
+
dble double
|
| 112 |
+
dess dessert
|
| 113 |
+
doyp doypack
|
| 114 |
+
harib harib
|
| 115 |
+
et etui
|
| 116 |
+
exc excellence
|
| 117 |
+
excel excellence
|
| 118 |
+
frit friture
|
| 119 |
+
fritu friture
|
| 120 |
+
fritur friture
|
| 121 |
+
gd grand
|
| 122 |
+
gr grand
|
| 123 |
+
grd grand
|
| 124 |
+
grchoc grand chocolat
|
| 125 |
+
lat lait
|
| 126 |
+
ass assorti
|
| 127 |
+
assoti assorti
|
| 128 |
+
noug nougatine
|
| 129 |
+
nougat nougatine
|
| 130 |
+
sct secret
|
| 131 |
+
cho chocolat
|
| 132 |
+
bisc biscuit
|
| 133 |
+
am amande
|
| 134 |
+
liq liqueur
|
| 135 |
+
tabl tablette
|
| 136 |
+
asst assorti
|
| 137 |
+
bil bille
|
| 138 |
+
vali valisette
|
| 139 |
+
cda chevaliers d argouges
|
| 140 |
+
tub tubo
|
| 141 |
+
gril grille
|
| 142 |
+
amandesgrilles amandes grilles
|
| 143 |
+
ball ballotin
|
| 144 |
+
piecestubo pieces tubo
|
| 145 |
+
bonb bonbon
|
| 146 |
+
dej dejeuner
|
App/utils/divers_function.py
CHANGED
|
@@ -123,4 +123,26 @@ def cosine_similarity_between_expressions(expr1, expr2):
|
|
| 123 |
vectors = vectorizer.fit_transform([expr1, expr2])
|
| 124 |
similarity = cosine_similarity(vectors[0], vectors[1])
|
| 125 |
|
| 126 |
-
return similarity[0][0]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 123 |
vectors = vectorizer.fit_transform([expr1, expr2])
|
| 124 |
similarity = cosine_similarity(vectors[0], vectors[1])
|
| 125 |
|
| 126 |
+
return similarity[0][0]
|
| 127 |
+
|
| 128 |
+
def ajout_simularite(data) :
|
| 129 |
+
data["ITEM_DESC_avant_clean"] = data["ITEM_DESC_x"].apply(data_cleaning)
|
| 130 |
+
data["ITEM_DESC_apres_clean"] = data["ITEM_DESC_y"].apply(data_cleaning)
|
| 131 |
+
|
| 132 |
+
stop = stopwords.words('french')
|
| 133 |
+
data['ITEM_DESC_avant_clean'] = data['ITEM_DESC_avant_clean'].apply(lambda x: " ".join(x for x in x.split() if x not in stop))
|
| 134 |
+
data['ITEM_DESC_apres_clean'] = data['ITEM_DESC_apres_clean'].apply(lambda x: " ".join(x for x in x.split() if x not in stop))
|
| 135 |
+
|
| 136 |
+
stop = stopwords.words('english')
|
| 137 |
+
data['ITEM_DESC_avant_clean'] = data['ITEM_DESC_avant_clean'].apply(lambda x: " ".join(x for x in x.split() if x not in stop))
|
| 138 |
+
data['ITEM_DESC_apres_clean'] = data['ITEM_DESC_apres_clean'].apply(lambda x: " ".join(x for x in x.split() if x not in stop))
|
| 139 |
+
|
| 140 |
+
data['ITEM_DESC_avant_clean'] = data['ITEM_DESC_avant_clean'].apply(remove_stop_words)
|
| 141 |
+
data['ITEM_DESC_apres_clean'] = data['ITEM_DESC_apres_clean'].apply(remove_stop_words)
|
| 142 |
+
|
| 143 |
+
data['ITEM_DESC_avant_clean'] = data['ITEM_DESC_avant_clean'].apply(standardization)
|
| 144 |
+
data['ITEM_DESC_apres_clean'] = data['ITEM_DESC_apres_clean'].apply(standardization)
|
| 145 |
+
|
| 146 |
+
data["Cosinus similarité"] = data.apply(lambda row: cosine_similarity_between_expressions(row['ITEM_DESC_apres_clean'], row['ITEM_DESC_avant_clean']), axis=1)
|
| 147 |
+
|
| 148 |
+
return data
|
app.py
CHANGED
|
@@ -11,7 +11,7 @@ from App.utils.filter_dataframe import *
|
|
| 11 |
# Page configuration
|
| 12 |
st.set_page_config(
|
| 13 |
page_title="Gestion des ruptures",
|
| 14 |
-
page_icon="Carrefour_logo.png",
|
| 15 |
layout="wide"
|
| 16 |
)
|
| 17 |
hide_streamlit_style = """
|
|
@@ -22,7 +22,6 @@ hide_streamlit_style = """
|
|
| 22 |
st.markdown(hide_streamlit_style, unsafe_allow_html=True)
|
| 23 |
|
| 24 |
|
| 25 |
-
|
| 26 |
def app():
|
| 27 |
st.title("Gestion des ruptures ")
|
| 28 |
|
|
@@ -72,7 +71,7 @@ def app():
|
|
| 72 |
st.subheader("Show data with ratios")
|
| 73 |
merged_final.loc[:, "Evaluation"]= True
|
| 74 |
merged_final = st.data_editor(merged_final)
|
| 75 |
-
|
| 76 |
|
| 77 |
csv = convert_df(merged_final)
|
| 78 |
st.download_button(label="Download data as CSV",
|
|
@@ -105,7 +104,7 @@ def app():
|
|
| 105 |
st.subheader("Data without decision-making")
|
| 106 |
df.loc[:, "Evaluation"] = True
|
| 107 |
df = st.data_editor(df)
|
| 108 |
-
|
| 109 |
st.download_button(label="Download data as CSV",
|
| 110 |
data=csv,
|
| 111 |
file_name='sample_df.csv',
|
|
@@ -115,7 +114,7 @@ def app():
|
|
| 115 |
st.subheader("Data with proposed changes")
|
| 116 |
finale_df.loc[:, "Evaluation"] = True
|
| 117 |
finale_df = st.data_editor(finale_df)
|
| 118 |
-
|
| 119 |
csv_f = convert_df(finale_df)
|
| 120 |
st.download_button(label="Download data as CSV",
|
| 121 |
data=csv_f,
|
|
@@ -131,7 +130,7 @@ def app():
|
|
| 131 |
st.subheader("Data without decision-making")
|
| 132 |
priority_data.loc[:, "Evaluation"] = True
|
| 133 |
priority_data = st.data_editor(priority_data)
|
| 134 |
-
|
| 135 |
csv_f = convert_df(priority_data)
|
| 136 |
st.download_button(label="Download data as CSV",
|
| 137 |
data=csv_f,
|
|
@@ -142,7 +141,7 @@ def app():
|
|
| 142 |
st.subheader("Equality case")
|
| 143 |
df_equa.loc[:, "Evaluation"]= True
|
| 144 |
df_equa = st.data_editor(df_equa)
|
| 145 |
-
|
| 146 |
csv_f = convert_df(df_equa)
|
| 147 |
st.download_button(label="Download data as CSV",
|
| 148 |
data=csv_f,
|
|
@@ -162,13 +161,13 @@ def app():
|
|
| 162 |
mime='text/csv',)
|
| 163 |
|
| 164 |
|
| 165 |
-
|
| 166 |
max_poids_index = df_nequa_.groupby('BARCODE')['Poids'].idxmax()
|
| 167 |
|
| 168 |
-
|
| 169 |
df_max_poids = df_nequa_.loc[max_poids_index]
|
| 170 |
df_max_poids.drop(["COUNTRY_KEY"], axis = 1, inplace= True)
|
| 171 |
-
finale_df_ = Merger(data,df_max_poids, product_id, class_id)
|
| 172 |
with tab4 :
|
| 173 |
st.subheader("Cases of inequality")
|
| 174 |
finale_df_.loc[:, "Evaluation"]= True
|
|
@@ -188,7 +187,7 @@ def app():
|
|
| 188 |
# Récupérer les lignes correspondantes
|
| 189 |
df_max_poids1 = df_nequa_1.loc[max_poids_index1]
|
| 190 |
df_max_poids1.drop(["COUNTRY_KEY"], axis = 1, inplace= True)
|
| 191 |
-
finale_df_1 = Merger(data,df_max_poids1, product_id, class_id)
|
| 192 |
finale_df_1.loc[:, "Evaluation"]= True
|
| 193 |
finale_df_1 = st.data_editor(finale_df_1)
|
| 194 |
csv_f = convert_df(finale_df_1)
|
|
|
|
| 11 |
# Page configuration
|
| 12 |
st.set_page_config(
|
| 13 |
page_title="Gestion des ruptures",
|
| 14 |
+
page_icon="images/Carrefour_logo.png",
|
| 15 |
layout="wide"
|
| 16 |
)
|
| 17 |
hide_streamlit_style = """
|
|
|
|
| 22 |
st.markdown(hide_streamlit_style, unsafe_allow_html=True)
|
| 23 |
|
| 24 |
|
|
|
|
| 25 |
def app():
|
| 26 |
st.title("Gestion des ruptures ")
|
| 27 |
|
|
|
|
| 71 |
st.subheader("Show data with ratios")
|
| 72 |
merged_final.loc[:, "Evaluation"]= True
|
| 73 |
merged_final = st.data_editor(merged_final)
|
| 74 |
+
|
| 75 |
|
| 76 |
csv = convert_df(merged_final)
|
| 77 |
st.download_button(label="Download data as CSV",
|
|
|
|
| 104 |
st.subheader("Data without decision-making")
|
| 105 |
df.loc[:, "Evaluation"] = True
|
| 106 |
df = st.data_editor(df)
|
| 107 |
+
|
| 108 |
st.download_button(label="Download data as CSV",
|
| 109 |
data=csv,
|
| 110 |
file_name='sample_df.csv',
|
|
|
|
| 114 |
st.subheader("Data with proposed changes")
|
| 115 |
finale_df.loc[:, "Evaluation"] = True
|
| 116 |
finale_df = st.data_editor(finale_df)
|
| 117 |
+
|
| 118 |
csv_f = convert_df(finale_df)
|
| 119 |
st.download_button(label="Download data as CSV",
|
| 120 |
data=csv_f,
|
|
|
|
| 130 |
st.subheader("Data without decision-making")
|
| 131 |
priority_data.loc[:, "Evaluation"] = True
|
| 132 |
priority_data = st.data_editor(priority_data)
|
| 133 |
+
|
| 134 |
csv_f = convert_df(priority_data)
|
| 135 |
st.download_button(label="Download data as CSV",
|
| 136 |
data=csv_f,
|
|
|
|
| 141 |
st.subheader("Equality case")
|
| 142 |
df_equa.loc[:, "Evaluation"]= True
|
| 143 |
df_equa = st.data_editor(df_equa)
|
| 144 |
+
|
| 145 |
csv_f = convert_df(df_equa)
|
| 146 |
st.download_button(label="Download data as CSV",
|
| 147 |
data=csv_f,
|
|
|
|
| 161 |
mime='text/csv',)
|
| 162 |
|
| 163 |
|
| 164 |
+
|
| 165 |
max_poids_index = df_nequa_.groupby('BARCODE')['Poids'].idxmax()
|
| 166 |
|
| 167 |
+
|
| 168 |
df_max_poids = df_nequa_.loc[max_poids_index]
|
| 169 |
df_max_poids.drop(["COUNTRY_KEY"], axis = 1, inplace= True)
|
| 170 |
+
finale_df_ = Merger(data,df_max_poids, product_id, class_id)
|
| 171 |
with tab4 :
|
| 172 |
st.subheader("Cases of inequality")
|
| 173 |
finale_df_.loc[:, "Evaluation"]= True
|
|
|
|
| 187 |
# Récupérer les lignes correspondantes
|
| 188 |
df_max_poids1 = df_nequa_1.loc[max_poids_index1]
|
| 189 |
df_max_poids1.drop(["COUNTRY_KEY"], axis = 1, inplace= True)
|
| 190 |
+
finale_df_1 = ajout_simularite(Merger(data,df_max_poids1, product_id, class_id))
|
| 191 |
finale_df_1.loc[:, "Evaluation"]= True
|
| 192 |
finale_df_1 = st.data_editor(finale_df_1)
|
| 193 |
csv_f = convert_df(finale_df_1)
|
Carrefour_logo.png → images/Carrefour_logo.png
RENAMED
|
File without changes
|
logo.png → images/logo.png
RENAMED
|
File without changes
|
query
DELETED
|
@@ -1 +0,0 @@
|
|
| 1 |
-
docker
|
|
|
|
|
|
start
DELETED
|
@@ -1 +0,0 @@
|
|
| 1 |
-
docker
|
|
|
|
|
|
stop
DELETED
|
@@ -1 +0,0 @@
|
|
| 1 |
-
docker
|
|
|
|
|
|