Toggle navigation
Toggle navigation
This project
Loading...
Sign in
bluejoyq
/
searchGuide
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
김서영
2019-11-23 15:08:19 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
6c320e51b6fecb699d93d250fe35a118b056e291
6c320e51
1 parent
72d2a5f1
add machine read model
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
0 deletions
api/apiRequest.js
api/apiRequest.js
View file @
6c320e5
...
...
@@ -75,4 +75,30 @@ apiRequest.Korean = async ( text ) => {
});
}
const
DOCVECAPI
=
(
searchResults
,
keywordText
,
index
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
apiReqOption
=
{
method
:
"POST"
,
uri
:
"http://127.0.0.1:5000/analyze"
,
body
:
{
sentence1
:
searchResults
[
index
].
passage
,
sentence2
:
keywordText
},
json
:
true
};
rp
.
post
(
apiReqOption
)
.
then
(
body
=>
{
if
(
body
.
result
==
"-1"
)
{
throw
new
Error
(
body
.
data
+
" index : "
+
index
);
}
searchResults
[
index
].
confidence
=
Number
(
body
.
result
);
resolve
();
})
.
catch
(
err
=>
{
searchResults
[
index
].
confidence
=
0
;
resolve
();
});
});
};
module
.
exports
=
apiRequest
;
...
...
Please
register
or
login
to post a comment