Guide / Text analysis

Sentiment on every row, priced like a regex

Not every text problem needs a model. Sentiment, keywords, entities and language detection can be deterministic, explainable and cheap enough to run on the whole table.

The two kinds of text endpoints

Lexicon and rule based endpoints are deterministic: same input, same output, no tokens, no bill that scales with prose. Neural endpoints (summaries, rewrites, zero-shot classification, translation) cost more and take seconds instead of milliseconds. Pick per column, not per project.

TaskMethodLatencyCost class
sentimentAFINN-style lexicon with negation handling152ms p50 client round tripfree
keywordsterm frequency with stop words and phrase mergingunder 100msfree
entitiespattern and shape matchingunder 100msfree
languagescript plus trigram detectionunder 100msfree
summarize / rewrite / classify / translateWorkers AI model1-3sneural

The request

curl -s -X POST 'https://textmind.p.rapidapi.com/v1/sentiment' \
  -H 'Content-Type: application/json' \
  -H 'X-RapidAPI-Key: YOUR_KEY' \
  -H 'X-RapidAPI-Host: textmind.p.rapidapi.com' \
  -d '{"text":"The deploy was smooth and the tests all passed."}'

The response explains itself

{
  "score": 0.0444,
  "label": "neutral",
  "rawScore": 2,
  "tokens": 9,
  "matchedTokens": 1,
  "negatedTokens": 0,
  "topPositive": [{ "token": "smooth", "valence": 2, "count": 1 }],
  "topNegative": [],
  "meta": { "costClass": "free", "method": "afinn-lexicon-v1" }
}

That is the whole point of a lexicon method: you can see which word moved the score. When a result looks wrong you can fix the input or the threshold, not retrain a model.

Where it breaks

  • Sarcasm and irony read as positive because the words are positive.
  • Negation scoping handles the common cases (not good, never great) and not the exotic ones.
  • Domain vocabulary matters: in finance, volatile is neutral, not negative.
  • If your text is short and idiomatic, the neural endpoints on the same API will do better. Use them for the rows that matter, not the whole table.

A sensible pipeline

Run the deterministic endpoints on everything, store the label and score, then send only the ambiguous band (say 0.4 to 0.6) through the neural endpoint. You get coverage and accuracy without paying for both on every row.

Try TextMind

Pay as you go at $0.05 a call, no monthly minimum. or a monthly plan from $25 once the volume justifies it.

Open the listing on RapidAPI