Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cogniStance
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
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
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Thomas Edwards
cogniStance
Commits
ae9497ac
Commit
ae9497ac
authored
4 weeks ago
by
Marc Roig Vilamala
Browse files
Options
Downloads
Patches
Plain Diff
Added API endpoint for stance function
parent
c65257d3
Branches
c_stance
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
api/api_functions.py
+10
-1
10 additions, 1 deletion
api/api_functions.py
main.py
+13
-1
13 additions, 1 deletion
main.py
with
23 additions
and
2 deletions
api/api_functions.py
+
10
−
1
View file @
ae9497ac
from
flask
import
make_response
,
jsonify
from
func.ner.ner
import
*
from
func.nlp_stance.nlp_stance
import
run_nlp_stance_on_text
from
func.sentiment.sentiment
import
*
from
func.translation.translation
import
run_translation_on_text
from
func.usas.usas
import
*
...
...
@@ -132,4 +133,12 @@ def get_dataset_ids():
if
result
[
"
code
"
]
==
"
SUCCESS
"
:
return
make_response
(
jsonify
(
result
),
200
)
return
make_response
(
jsonify
(
result
),
400
)
\ No newline at end of file
return
make_response
(
jsonify
(
result
),
400
)
def
run_nlp_stance
(
table
,
dataset_id
):
result
=
run_nlp_stance_on_text
(
table
,
dataset_id
)
if
result
[
"
code
"
]
==
"
SUCCESS
"
:
return
make_response
(
jsonify
(
result
),
201
)
return
make_response
(
jsonify
(
result
),
400
)
This diff is collapsed.
Click to expand it.
main.py
+
13
−
1
View file @
ae9497ac
...
...
@@ -123,4 +123,16 @@ def getfiles():
page
=
request_data
[
'
dataset_id
'
]
result
=
get_files_all
(
page
)
return
result
\ No newline at end of file
return
result
@app.route
(
"
/nlpStance
"
,
methods
=
[
'
POST
'
])
def
nlp_stance
():
request_data
=
request
.
get_json
()
result
=
run_nlp_stance
(
table
=
request_data
[
'
table
'
],
dataset_id
=
request_data
[
'
dataset_id
'
]
)
return
result
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