- Create a .env file and add your Alchemy API key. See the .env.example file.
rake db:create db:migratebundle install- Run tests with
rspecorrake spec
You can post json data to /api/terms and you will receive a JSON response with the extracted keywords.
body = {
"filename": "test.txt",
"source_text": "Hello, my name is Nathanael Burt. I'm from Irvine, CA.",
"max_retrieve": "2"
}
POST '/api/terms', body, {'Accept' => 'application/json'}
{
"query_id": 31,
"created_at": "2014-07-29T19:10:29.534Z",
"terms": [
{
"text": "Nathanael Burt",
"count": 1,
"relevance": "0.969646"
},
{
"text": "Irvine",
"count": null,
"relevance": "0.618389"
}
]
}
This API will run both an entity analysis and a keyword analysis. Since keyword analysis does not return a count, keywords that are pulled out will have a count of "null".