Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
M
meanspec-hwinfo-daemon
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
MeanSpec (SCE338 2024-2 Group 1)
meanspec-hwinfo-daemon
Commits
6a4bdaeb
Commit
6a4bdaeb
authored
6 months ago
by
Eunhak Lee
Browse files
Options
Downloads
Patches
Plain Diff
hotfix: similarity threshold 를 키움
너무 많은 경우에 자신의 부품이 아닌데도 매칭되는 경우가 생김
parent
2c32e38f
No related branches found
No related tags found
No related merge requests found
Pipeline
#10789
passed
6 months ago
Stage: deploy
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
push_to_db.py
+1
-1
1 addition, 1 deletion
push_to_db.py
with
1 addition
and
1 deletion
push_to_db.py
+
1
−
1
View file @
6a4bdaeb
...
...
@@ -18,7 +18,7 @@ from datetime import datetime, timedelta
def
check_similarity
(
_conn
,
name
,
part_type
):
_cursor
=
_conn
.
cursor
()
where_clause
=
"
WHERE type =
'
{}
'"
.
format
(
part_type
.
upper
())
if
part_type
else
""
_auto_threshold
=
1.0
if
part_type
in
(
'
RAM
'
,
'
SSD
'
,
'
HDD
'
,)
else
0.
13
_auto_threshold
=
1.0
if
part_type
in
(
'
RAM
'
,
'
SSD
'
,
'
HDD
'
,)
else
0.
5
_cursor
.
execute
(
"
WITH comp AS (SELECT id, name, similarity(name::text, %s::text) as sim FROM parts
"
+
where_clause
+
"
) SELECT * FROM comp WHERE sim >=%s ORDER BY sim DESC LIMIT 5;
"
,
(
name
,
_auto_threshold
,))
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment