Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
2022-138
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
2022-138
2022-138
Commits
7e5ea71a
Commit
7e5ea71a
authored
Oct 10, 2022
by
Kumarasinghe S.M
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "Merge branch 'IT19166766-master-patch-42872' into 'master'"
This reverts merge request
!9
parent
f3afb718
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
46 additions
and
0 deletions
+46
-0
user navigating system/content-based-filtering.py
user navigating system/content-based-filtering.py
+37
-0
user navigating system/member.csv
user navigating system/member.csv
+9
-0
No files found.
user navigating system/content-based-filtering.py
0 → 100644
View file @
7e5ea71a
# -*- coding: utf-8 -*-
"""Untitled0.ipynb
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/1azOWgncdssP40BQnyGVyxkVsYf2ZtNuJ
"""
import
pandas
as
pd
import
numpy
as
np
from
sklearn.feature_extraction.text
import
TfidfVectorizer
df
=
pd
.
read_csv
(
'member.csv'
)
tfidf
=
TfidfVectorizer
(
stop_words
=
'english'
)
df
[
'des'
]
=
df
[
'des'
]
.
fillna
(
""
)
tfidf_matrix
=
tfidf
.
fit_transform
(
df
[
'des'
])
from
sklearn.metrics.pairwise
import
linear_kernel
cs
=
linear_kernel
(
tfidf_matrix
,
tfidf_matrix
)
indices
=
pd
.
Series
(
df
.
index
,
index
=
df
[
'occ'
])
.
drop_duplicates
()
indices
def
get_reco
(
title
,
cs
=
cs
):
idx
=
indices
[
title
]
ss
=
enumerate
(
cs
[
idx
])
ss
=
sorted
(
ss
,
key
=
lambda
x
:
x
[
1
],
reverse
=
True
)
ss
=
ss
[
0
:
3
]
si
=
[
i
[
0
]
for
i
in
ss
]
print
(
df
[
'occ'
]
.
iloc
[
si
])
get_reco
(
'tattoo artist'
)
user navigating system/member.csv
0 → 100644
View file @
7e5ea71a
occ,des,,
tattoo artist,tattoo based in Colombo,,
fashion designer,"fashion, model, designer",,
tattoo professional,tattoo artist based in Colombo,,
graphic designer,mbbnb,,
teacher,b nb n nb ,,
doctor,jhjhvjhvjhjhvjhv,,
,,,
,,,0
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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