Spaces:
Runtime error
Runtime error
Upload 12 files
Browse files- .gitattributes +7 -0
- Recommandation system Djitsep alsira .ipynb +0 -0
- cloud-storage-background-remixed-from-public-domain-by-nasa.jpg +3 -0
- programming-background-with-person-working-with-codes-computer.jpg +3 -0
- projet de soutenace_systeme de recommandation.ipynb +0 -0
- requirement-confidential-develop-extend-proof.jpg +3 -0
- requirements.txt +6 -7
- standard-quality-control-concept-m (1).jpg +3 -0
- standard-quality-control-concept-m (2).jpg +3 -0
- standard-quality-control-concept-m.jpg +3 -0
- tmp1.py +73 -0
- website-hosting-concept-with-circuits.jpg +3 -0
.gitattributes
CHANGED
|
@@ -33,3 +33,10 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
+
cloud-storage-background-remixed-from-public-domain-by-nasa.jpg filter=lfs diff=lfs merge=lfs -text
|
| 37 |
+
programming-background-with-person-working-with-codes-computer.jpg filter=lfs diff=lfs merge=lfs -text
|
| 38 |
+
requirement-confidential-develop-extend-proof.jpg filter=lfs diff=lfs merge=lfs -text
|
| 39 |
+
standard-quality-control-concept-m[[:space:]](1).jpg filter=lfs diff=lfs merge=lfs -text
|
| 40 |
+
standard-quality-control-concept-m[[:space:]](2).jpg filter=lfs diff=lfs merge=lfs -text
|
| 41 |
+
standard-quality-control-concept-m.jpg filter=lfs diff=lfs merge=lfs -text
|
| 42 |
+
website-hosting-concept-with-circuits.jpg filter=lfs diff=lfs merge=lfs -text
|
Recommandation system Djitsep alsira .ipynb
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
cloud-storage-background-remixed-from-public-domain-by-nasa.jpg
ADDED
|
Git LFS Details
|
programming-background-with-person-working-with-codes-computer.jpg
ADDED
|
Git LFS Details
|
projet de soutenace_systeme de recommandation.ipynb
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
requirement-confidential-develop-extend-proof.jpg
ADDED
|
Git LFS Details
|
requirements.txt
CHANGED
|
@@ -1,7 +1,6 @@
|
|
| 1 |
-
streamlit
|
| 2 |
-
pandas
|
| 3 |
-
scikit-learn
|
| 4 |
-
numpy
|
| 5 |
-
matplotlib
|
| 6 |
-
neattext
|
| 7 |
-
streamlit-extras
|
|
|
|
| 1 |
+
streamlit
|
| 2 |
+
pandas
|
| 3 |
+
scikit-learn
|
| 4 |
+
numpy
|
| 5 |
+
matplotlib
|
| 6 |
+
neattext
|
|
|
standard-quality-control-concept-m (1).jpg
ADDED
|
Git LFS Details
|
standard-quality-control-concept-m (2).jpg
ADDED
|
Git LFS Details
|
standard-quality-control-concept-m.jpg
ADDED
|
Git LFS Details
|
tmp1.py
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import streamlit as st
|
| 2 |
+
import streamlit.components.v1 as stc
|
| 3 |
+
import pandas as pd
|
| 4 |
+
from sklearn.feature_extraction.text import CountVectorizer
|
| 5 |
+
from sklearn.metrics.pairwise import cosine_similarity,linear_kernel
|
| 6 |
+
import re
|
| 7 |
+
import pandas as pd
|
| 8 |
+
import numpy as np
|
| 9 |
+
import matplotlib.pyplot as plt
|
| 10 |
+
import neattext.functions as nfx
|
| 11 |
+
from sklearn.feature_extraction.text import TfidfVectorizer, CountVectorizer
|
| 12 |
+
from sklearn.metrics.pairwise import cosine_similarity
|
| 13 |
+
import warnings
|
| 14 |
+
st.set_page_config(layout="wide", initial_sidebar_state="expanded")
|
| 15 |
+
|
| 16 |
+
warnings.filterwarnings("ignore")
|
| 17 |
+
data= pd.read_csv("udemy_courses.csv")
|
| 18 |
+
data["titre_OK"]= data.course_title.apply(nfx.remove_stopwords)
|
| 19 |
+
data["titre_OK"]= data.course_title.apply(nfx.remove_special_characters)
|
| 20 |
+
countVec= CountVectorizer()
|
| 21 |
+
cv= countVec.fit_transform(data.titre_OK)
|
| 22 |
+
df=data
|
| 23 |
+
matrice_cosine= cosine_similarity(cv)
|
| 24 |
+
|
| 25 |
+
def recommend_course2(title, numrec=10):
|
| 26 |
+
try:
|
| 27 |
+
pattern = re.compile(re.escape(title), re.IGNORECASE)
|
| 28 |
+
matching_courses = df['course_title'].apply(lambda x: bool(pattern.search(x)))
|
| 29 |
+
index = df[matching_courses].index[0]
|
| 30 |
+
scores = list(enumerate(matrice_cosine[index]))
|
| 31 |
+
sorted_scores = sorted(scores, key=lambda x: x[1], reverse=True)
|
| 32 |
+
selected_course_index = [i[0] for i in sorted_scores[1:]]
|
| 33 |
+
selected_course_score = [i[1] for i in sorted_scores[1:]]
|
| 34 |
+
rec_df = df.iloc[selected_course_index]
|
| 35 |
+
rec_df['Similarity_Score'] = selected_course_score
|
| 36 |
+
|
| 37 |
+
final_recommended_courses = rec_df[["course_title","level", "subject","Similarity_Score"]]
|
| 38 |
+
except:
|
| 39 |
+
final_recommended_courses= pd.DataFrame({"data": "Aucune Recommendaion disponible!"},index=[0])
|
| 40 |
+
|
| 41 |
+
return final_recommended_courses.head(numrec)
|
| 42 |
+
|
| 43 |
+
|
| 44 |
+
|
| 45 |
+
def main():
|
| 46 |
+
|
| 47 |
+
st.title("Système de Recommandation de Cours")
|
| 48 |
+
|
| 49 |
+
menu = ["Accueil","Recommendations","A propos"]
|
| 50 |
+
choice = st.sidebar.selectbox("Menu",menu)
|
| 51 |
+
|
| 52 |
+
|
| 53 |
+
if choice == "Accueil":
|
| 54 |
+
st.subheader("Accueil")
|
| 55 |
+
st.dataframe(df.head(10))
|
| 56 |
+
|
| 57 |
+
|
| 58 |
+
elif choice == "Recommendations":
|
| 59 |
+
st.subheader("Recommendations de formation")
|
| 60 |
+
search_term = st.text_input("cours")
|
| 61 |
+
num_of_rec = st.sidebar.number_input("Nombre de cours",4,30,7)
|
| 62 |
+
if st.button("Recommendations"):
|
| 63 |
+
if search_term:
|
| 64 |
+
st.write(recommend_course2(search_term, num_of_rec))
|
| 65 |
+
else:
|
| 66 |
+
st.subheader("A propos")
|
| 67 |
+
st.text("Keyce @2024")
|
| 68 |
+
|
| 69 |
+
|
| 70 |
+
if __name__ == '__main__':
|
| 71 |
+
main()
|
| 72 |
+
|
| 73 |
+
|
website-hosting-concept-with-circuits.jpg
ADDED
|
Git LFS Details
|