Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question / no question lambda function and the endpoint #171

Open
wants to merge 3 commits into
base: development
Choose a base branch
from

Conversation

zmagar
Copy link
Contributor

@zmagar zmagar commented Mar 19, 2022

Issue #120
This is and API endpoint to the function that returns the answer if the sent sentence is a question or no.
Endpoint link: https://050l3ftzue.execute-api.us-west-2.amazonaws.com/default/ab-isQuestion

To test:
Using CURL:
Send a request in any command line shell:
curl -X POST 'https://050l3ftzue.execute-api.us-west-2.amazonaws.com/default/ab-isQuestion' -d '{
"sentence": "Is this a question?"}'
Replace text inside the JSON body with your sentence ("sentence": "your sentence here")
You should get a response from the server with the answer "this is a question" or "this is not a question"

Via Postman (web app or a desktop):
Paste the API link https://050l3ftzue.execute-api.us-west-2.amazonaws.com/default/ab-isQuestion to the Postman, choose POST method and modify body by creating a JSON object with key "sentence" and value "(enter your sentence here") like this:
Screenshot 2022-03-19 110956

In the response window you should see a response from the server with the answer question/no question

@zmagar zmagar added this to the Sprint 04 milestone Mar 19, 2022
@zmagar zmagar self-assigned this Mar 19, 2022
@zmagar zmagar linked an issue Mar 19, 2022 that may be closed by this pull request
Copy link
Contributor

@crystalbroderick crystalbroderick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The response is different from the api docs("isQuestion": boolean)
Also, the response doesn't need to include status code 200 on lambda

Other than that, it did get the expected results!
Screen Shot 2022-03-19 at 1 58 13 PM
a

@zmagar zmagar requested a review from crystalbroderick March 19, 2022 22:14
@zmagar
Copy link
Contributor Author

zmagar commented Mar 19, 2022

Thank you @crystalbroderick , I updated the function to send back boolean isQuestion, and removed the statusCode

Copy link
Contributor

@eknigge eknigge left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some clean up to do - should be quick. Then can approve.

backend/scripts/nlp/README.md Outdated Show resolved Hide resolved
backend/scripts/nlp/lambda_function.py Outdated Show resolved Hide resolved
backend/scripts/nlp/lambda_function.py Outdated Show resolved Hide resolved
backend/scripts/nlp/lambda_function.py Outdated Show resolved Hide resolved
@zmagar zmagar requested a review from eknigge March 22, 2022 18:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Expose the question/no-question ML model as API from Sagemaker
3 participants