Skip to content

Latest commit

 

History

History
96 lines (88 loc) · 1.65 KB

README.md

File metadata and controls

96 lines (88 loc) · 1.65 KB

Description

Flask API that filters texts into word vectors filtered by the occurrence of unique words inside the text. The program will clean the input text, removing punctuation, strings that begin with number and remove stop words. The app is alphabetically ordered.

POST is the only method allowed.

Endpoint

This endpoint works at the /. Receives a object({}) with key as 'texts' and an array as value.

Post: '/'

{
	"texts": ["Falar é fácil. Mostre-me o código."]
}

Response

{
    "unique_words": [
        "código",
        "falar",
        "fácil",
        "mostre"
    ],
    "word_count": {
        "0": [
            1,
            1,
            1,
            1
        ]
    }
}

Parameter

This endpoint receive a ngrams parameter, that will separate the input text into the number passed as parameter

Post: '/?ngrams=2'

{
	"texts": ["Falar é fácil. Mostre-me o código."]
}

Response

{
    "unique_words": [
        "falar é",
        "fácil mostre",
        "me o",
        "mostre me",
        "o código",
        "é fácil"
    ],
    "word_count": {
        "0": [
            1,
            1,
            1,
            1,
            1,
            1
        ]
    }
}

Post: '/?ngrams=3'

{
	"texts": ["Falar é fácil. Mostre-me o código."]
}

Response

{
    "unique_words": [
        "falar é fácil",
        "fácil mostre me",
        "me o código",
        "mostre me o",
        "é fácil mostre"
    ],
    "word_count": {
        "0": [
            1,
            1,
            1,
            1,
            1
        ]
    }
}