COULIBALY BOURAHIMA commited on
Commit
fa8b2f8
1 Parent(s): d8799c7

similarité fonction

Browse files
App/functions_rupture/__pycache__/functions_gestion.cpython-311.pyc CHANGED
Binary files a/App/functions_rupture/__pycache__/functions_gestion.cpython-311.pyc and b/App/functions_rupture/__pycache__/functions_gestion.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/divers_function.py CHANGED
@@ -1,6 +1,9 @@
1
  import streamlit as st
2
  import pandas as pd
3
  import re
 
 
 
4
  from App.utils.standadisation import *
5
  from nltk.corpus import stopwords
6
  from nltk.stem import PorterStemmer
@@ -113,3 +116,11 @@ def french_stemmer(strings):
113
  strings = ' '.join(stemmed_list)
114
  return strings
115
 
 
 
 
 
 
 
 
 
 
1
  import streamlit as st
2
  import pandas as pd
3
  import re
4
+ from sklearn.feature_extraction.text import CountVectorizer
5
+ from sklearn.metrics.pairwise import cosine_similarity
6
+
7
  from App.utils.standadisation import *
8
  from nltk.corpus import stopwords
9
  from nltk.stem import PorterStemmer
 
116
  strings = ' '.join(stemmed_list)
117
  return strings
118
 
119
+
120
+ def cosine_similarity_between_expressions(expr1, expr2):
121
+
122
+ vectorizer = CountVectorizer()
123
+ vectors = vectorizer.fit_transform([expr1, expr2])
124
+ similarity = cosine_similarity(vectors[0], vectors[1])
125
+
126
+ return similarity[0][0]
Carrefour_logo.png ADDED
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="logo.png",
15
  layout="wide"
16
  )
17
  hide_streamlit_style = """
 
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 = """
requirements.txt CHANGED
@@ -7,4 +7,5 @@ gunicorn
7
  nltk
8
  bcrypt
9
  regex
10
- joblib
 
 
7
  nltk
8
  bcrypt
9
  regex
10
+ joblib
11
+ scikit-learn