Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
neural-modules
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Admin message
Setting up 2FA is now mandatory for all users.
Show more breadcrumbs
ehai
neural-modules
Commits
d5102815
Commit
d5102815
authored
2 years ago
by
Lara Verheyen
Browse files
Options
Downloads
Patches
Plain Diff
fix: score returned as prob instead of tensor
parent
ad639fee
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
nmn/server/primitives/query.py
+4
-4
4 additions, 4 deletions
nmn/server/primitives/query.py
with
4 additions
and
4 deletions
nmn/server/primitives/query.py
+
4
−
4
View file @
d5102815
...
...
@@ -30,6 +30,7 @@ class Query(Primitive):
category
=
self
.
slots
[
"
attribute
"
],
concepts
=
concepts
,
)
# Specific detail relating to MNIST_Dialog
if
self
.
args
.
experiment
==
Experiment
.
MNIST_DIALOG
:
if
self
.
slots
[
"
attribute
"
]
==
"
number
"
:
...
...
@@ -47,7 +48,7 @@ class Query(Primitive):
json
.
dumps
(
{
"
bindings
"
:
[
[{
"
variable
"
:
"
target
"
,
"
score
"
:
prob
,
"
value
"
:
concept
}]
[{
"
variable
"
:
"
target
"
,
"
score
"
:
prob
.
item
()
,
"
value
"
:
concept
}]
]
}
),
...
...
@@ -69,7 +70,7 @@ class Query(Primitive):
label
=
self
.
args
.
config
.
categories
[
category
][
index
]
if
label
==
self
.
slots
[
"
target
"
]:
bindings
.
append
(
[{
"
variable
"
:
"
attribute
"
,
"
score
"
:
prob
,
"
value
"
:
category
}]
[{
"
variable
"
:
"
attribute
"
,
"
score
"
:
prob
.
item
()
,
"
value
"
:
category
}]
)
return
json
.
dumps
({
"
bindings
"
:
bindings
}),
200
...
...
@@ -88,7 +89,7 @@ class Query(Primitive):
bindings
.
append
(
[
{
"
variable
"
:
"
attribute
"
,
"
score
"
:
1.0
,
"
value
"
:
category
},
{
"
variable
"
:
"
target
"
,
"
score
"
:
prob
,
"
value
"
:
label
},
{
"
variable
"
:
"
target
"
,
"
score
"
:
prob
.
item
()
,
"
value
"
:
label
},
]
)
...
...
@@ -134,4 +135,3 @@ class Query(Primitive):
return
self
.
check_concept
()
else
:
self
.
raise_missing_case_error
()
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