soaxelbrooke / phrase

A tool for learning significant phrase/term models, and efficiently labeling with them.
Apache License 2.0
31 stars 3 forks source link

Add /count API endpoint #14

Open soaxelbrooke opened 5 years ago

soaxelbrooke commented 5 years ago

While counting is best done in bulk, its pretty clear there are instances where you'd prefer services to be interfacing with phrase over HTTP instead of relying on running a cron job to keep counts up to date.

soaxelbrooke commented 5 years ago

One big question: persistence - we want to make sure that counting is as atomic as possible. But, reading a whole partition and then writing it so you can count the document "love it" would be a waste. Perhaps we can keep a WAL of sorts in a sqlite database?

soaxelbrooke commented 5 years ago

Let's not overdo it for now - we can leave the batching to the client for now, and address it if its brought up later.