Are there any tools/APIs that provide this service?
- Free beer
- Free pizza
- Free stuff
- Craft Beer
- Draft Beer
- Free Beer
- Cheap Beer
The Oxford Collocations Dictionary uses data from a specific BYU corpus: the BNC.
Google Books NGram search allows searches with wild cards where you can specify part of speech.
For example, searching there for
'beer' preceded by any adjective, returns a chart of the most frequent such pairs:
For help on specifying these wild cards (it has a lot of restrictions) see the Google Books NGram help
But be wary of all the difficulties with Google books: the lack of specification of the corpus, OCR errors, dating problems, etc.
Also be aware that what you think the collocations are going to be like aren't necessarily what actually are the most frequent. And I don't think you can get beyond the top ten. The history graph is very pleasing but COCA will be much more informative.
Yes, What you're looking for is Word2vec. This is a machine learning method that learns a large corpus (e.g. one or more books) and stores a dictionary of words as vectors.
Given a context, e.g. a sentence with a gap, it computes which words are most likely based on the corpus it's trained on.
Contrary to ready-to-use tools, by making the embeddings yourself, you get to choose the theme. For example, Google's corpus considers a wide variety of texts, which is great for general insight. On the other hand, if you're interested in a specific field, you could build embeddings on texts from that field only, making the results more relevant for your context.