2

Are there any tools/APIs that provide this service?

Example:

(After) Free

  • Free beer
  • Free pizza
  • Free stuff

(Before) Beer

  • Craft Beer
  • Draft Beer
  • Free Beer
  • Cheap Beer

Thanks.

migrated from english.stackexchange.com Jun 19 at 1:55

This question came from our site for linguists, etymologists, and serious English language enthusiasts.

  • 2
    OXFORD Collocation Dictionary may be of help: freecollocation.com/search?word=Beer – user240918 Jun 16 at 20:17
  • 1
    As user 240918 has pointed out in the link, you are asking for "collocations". – Cascabel Jun 16 at 20:32
  • How about Google? – Hot Licks Jun 16 at 20:42
  • 2
    @HotLicks - Do you know a google trick for doing this? Please share. I'd like to learn how to do that. – aparente001 Jun 17 at 4:46
  • Most smart phone keyboard apps provide "Suggest words" feature. You can turn it on for suggestions for a word that might come after – Bella Swan Jun 17 at 6:20
  • @aparente001 - Google "beer". On the first page you get "craft beer", "flagship beer", "best beer'. Page 2: "beginner beer", "world of beer". Page 3: "true-to-style beer", "local beer", "wheat beer". – Hot Licks Jun 17 at 11:50
  • 2
    @HotLicks - That's not what I see. – aparente001 Jun 17 at 21:24
  • @aparente001 - So what did you see? – Hot Licks Jun 17 at 23:31
  • 1
    @HotLicks - Well, let's see. First there's a row of google search buttons: all, maps, news, images, shopping, more, (space), settings, tools. Then it tells me how many results there are and how long it took. Next I have a landscape view map of my area's beer stores. Below that are the three hits with address, phone, hours, website, directions link. Below that, "more places." That whole box is enclosed. Next section is "top stories." There are three, each with an image, headline and source. Next there are four hits: Beer - Wikipedia, BeerAdvocate, ... – aparente001 Jun 17 at 23:42
  • Beers Delivered in 1 Hour, The 50 Best Beers of 2018. Now comes another box, called "People also ask." To see an answer you have to click the down arrow. Next: a row of images. Finally after that it's the hits themselves, starting with "How Beer Works." – aparente001 Jun 17 at 23:43
  • @aparente001 - On my laptop using Firefox, after the "noise" I get seven regular links on the first page, 13 on the second, 10 each on the third and fourth. Obviously you have to sort out "drinking beer", "the beer", "our beer", etc, but that's straight-forward. – Hot Licks Jun 17 at 23:51
  • @HotLicks - That's just not remotely what I have. Is it an add-on, maybe? – aparente001 Jun 18 at 0:02
  • @aparente001 - You probably live near too many beer joints. Or else you're using the MS POS instead of Firefox. Windoze Exploder brings up an entirely different sequence vs Firefox. – Hot Licks Jun 18 at 0:32
  • @aparente001 - Actually, you don't have to switch to Firefox. In Exploder, on the URL line, type https://www.google.com/. You will get plain, vanilla Google. – Hot Licks Jun 18 at 0:40
  • @HotLicks - Normally I use Opera. I just tried Firefox but it looks the same. – aparente001 Jun 18 at 1:24
1

My favorite tools for this are the BYU corpora. Although there is no API access due to copyright, it is a very powerful tool, at least once you understand how to use it.

For example:

The Oxford Collocations Dictionary uses data from a specific BYU corpus: the BNC.

  • COCA is a great resource, especially this one which I don't think others have. – Mitch Jun 19 at 12:23
1

Google Books NGram search allows searches with wild cards where you can specify part of speech.

For example, searching there for

*_ADJ beer,

'beer' preceded by any adjective, returns a chart of the most frequent such pairs:

ADJ_* beer

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.

1

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.

For a more in-depth description. I suggest considering this question on datascience.SE. And for a deep dive, I'd suggest looking into the [word-embeddings] tag on that site.

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.

  • The word2vec framework doesn't work here. The end result of the process is to assign a vector to a single word with the expectation that nearby vectors share some meaning. You can't get syntax out of it (like one word appears next to another more often than a third). The process for finding good vectors usually takes all the words within a short distance of the target word (say within 5 in a sentence). This (small) 'bag of words' approach throws away the position. Common bigrams might be nearby in some coordinates, but for the most part, word2vec captures synonymy, not syntax. – Mitch Jun 19 at 18:41
  • Also the OP is looking for just the resource that will give a collocation, not to create that resource from a corpus. – Mitch Jun 19 at 18:47
  • @Mitch I don't think that's necessarily true. For example, consider section 2 on skip-gram in the original paper, it says: "The training objective of the Skip-gram model is to find word representations that are useful for predicting the surrounding words in a sentence or a document." – JJJ Jun 19 at 18:55

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .