A Rest API to detect the similarity between two sentences.
Server: Flask
Language: Python
Database: MongoDb
Container: Docker, Docker-Compose
ML: Spacy
POST /register
Parameter | Type | Description |
---|---|---|
username |
string |
Required. username to register |
password |
string |
Required. password of the user |
{
"username": "user2",
"password": "user_password"
}
{
"msg": "Sign up Successful",
"results": {
"similarity": null
},
"status": 200,
"userInformation": {
"currentTokens": 6,
"username": "user2"
}
}
POST /detect
Parameter | Type | Description |
---|---|---|
username |
string |
Required. username to validate user |
password |
string |
Required. password of the user |
text1 |
string |
Required. Sentence1 |
textt2 |
string |
Required. Sentence2 |
{
"username": "user2",
"password": "user_password",
"text1" : "you have ",
"text2" : "You My Have "
}
{
"msg": "Success",
"results": {
"similarity": 53.80624762110769
},
"status": 200,
"userInformation": {
"currentTokens": 5,
"username": "user2"
}
}
POST /refill
Parameter | Type | Description |
---|---|---|
username |
string |
Required. username to validate user |
admin_pw |
string |
Required. admin password |
refill |
integer |
Required. the number of tokens to add |
{
"username": "user2",
"admin_pw": "admin_password",
"refill" : 10
}
{
"msg": "Success",
"results": {
"similarity": null
},
"status": 200,
"userInformation": {
"currentTokens": 15,
"username": "user2"
}
}
-
Open your terminal in the required directory
-
Clone the repository
git clone git@github.com:stenzr/SimilarityService.git
- CD to the project directory
cd SimilarityService
- Build the docker images
sudo docker-compose build
- Start the Services
sudo docker-compose up
-
The server starts on localhost:5000
-
Use Postman to send request to the endpoints