New related types available

25 views
Skip to first unread message

Tony Tam

unread,
May 18, 2010, 1:10:38 AM5/18/10
to Wordnik API
You can now find three new related types of data in the API:

verb-stem. Pass in a verb like "running" and get the stem, which is
"run". Roughly 70k relationships of this type are now available

verb-form. Pass in "run" and find different verb forms, like
"running", "ran", and "runs".

same-context. Shows relationships between words which are often used
in the same manner. For instance "cheeseburger" and "pizza" are often
used the same way. Both also taste great.

You can scope your requests for related words as follows:

http://api.wordnik.com/api/word.json/cheeseburger/related?api_key={...}&type=same-context

Please let us know if you have questions, and as always--more data to
come shortly.

Tony

Michelle

unread,
May 18, 2010, 10:21:40 AM5/18/10
to Wordnik API
Good info. We'll give "type=same-context" a try.

I noticed a difference on the API results for related words today.
Yesterday, "hounds" returned "dog". Today "hounds" returns the
singular "hound", not dog. Do all related words for plurals return
the singular?

Thanks,

Michelle

Michelle

unread,
May 18, 2010, 10:31:30 AM5/18/10
to Wordnik API
We use type=synonym now. Why would we get the singular form of a word
when we ask for a synonym of a plural word?

A synonym for "hounds" was "dog" yesterday. Today it's "hound". Is
it an error?

The synonym for "hound" is "dog" which makes sense.

We can strip off the "s" before we run the call as a work around. But
I don't want to kluge it unless you intended this behavior.

Thanks,

Michelle

Tony Tam

unread,
May 18, 2010, 12:34:52 PM5/18/10
to Wordnik API
Hi Michelle, I'll look at why the same word is returned as a synonym.
It should not be. I'll have to look at the backup of related data
from before our update--I'm really not sure why you'd get dog as a
synonym for "hounds".

For "hounds" we do return the verb stem "hound", which is of course a
different sense from "hound" the noun. Looks like for this entry we
don't have a plural-noun form in the related words (i.e. dogs as a
synonym for hounds).

Part of the trick with "hound" that we don't know which form you're
looking for related items for--the verb or the noun. Much of our
related data is associated with the correct sense in the dictionary
(in this case, if you look at hound/definitions, senses 1-2 are for
the verb, 3-4 are for the noun). I'll see if we can add a parameter
to return the related items along with the definitions, or return the
related items for the part of speech that you specify.

Tony

Michelle

unread,
May 18, 2010, 12:46:51 PM5/18/10
to Wordnik API
Thanks for looking at this.

The API says the synonym for "ascends" is "ascend". "ascend" properly
produces "rise", "climb", etc... as synonyms.

Is that what your DB shows or is there something going on at our side?

Michelle

Tony Tam

unread,
May 18, 2010, 1:02:39 PM5/18/10
to Wordnik API
Hi Michelle--replying to your followup question about "ascends". I
think you might have a logic issue on your side. The API is telling
me that "ascend" is a verb-stem of "ascends", not a synonym. Can you
check the raw response in your client to confirm this?

Tony

On May 18, 7:31 am, Michelle <michellewald...@gmail.com> wrote:

Michelle

unread,
May 18, 2010, 1:07:56 PM5/18/10
to Wordnik API
Hi Tony,

The developer will be available to look at this in a few hours. On
our app, I ran "natal" and got "400th" which is "same-context", not a
synonym. http://www.wordnik.com/words/natal/related

We might be parsing the response wrong. Did the response format
change since yesterday? Just wondering.

Thanks so much for your fast help!

Michelle

Tony Tam

unread,
May 18, 2010, 1:13:01 PM5/18/10
to Wordnik API
The google groups web UI is acting a little weird right now so I can't
reply directly to your message.

The response format is exactly the same as before--there are just more
types of relationships, including same-context. If your developer is
having trouble with it, please have him reach out and we'll sort it
out.

It is true that there are some odd machine-derived "same-context"
relationships in the system. I'd love to find the examples that gave
it the notion to relate natal and 400th :)

In general, the related call will return you everything we have unless
you restrict it to a specific type, such as related?
type=synonym,antonym. In addition, it defaults to 10 relationships
unless you pass in a higher count (count=1000 for instance).

If the same-context is giving your app too much weirdness, you might
hold off using it a bit, there is another rev of that data happening
as I type.

Tony

kflorence

unread,
May 18, 2010, 2:02:40 PM5/18/10
to Wordnik API
First off, thank you for your quick turnaround time on this, quite
amazing really : )
I played around with it a bit last night and it seems to be working as
expected. I'll let you know if I run into any problems when I start
implementing it. I believe this is a very powerful new feature and
will come in handy in a number of situations.

Michelle

unread,
May 18, 2010, 3:31:00 PM5/18/10
to Wordnik API
Hi Tony,

We ran the call twice, first using the default count and then a count
of 25.

- What is the sort order of the response? Can we specify the sort
order? (e.g. most frequently occurring synonym? )

- And here's a weird result: When we use the default count,
"houndfish" is the first synonym. "houndfish" is not on the Wordnik
site as a synonym for "hound". Why would the API return a synonym
that is not on the main site? It looks like you are pulling your
synonyms from Allen's in this case.

Kindly advise,

Michelle



1. http://api.wordnik.com/api/word.xml/hound/related?type=synonym

<?xml version="1.0" encoding="UTF-8" standalone="yes"?
><relateds><related
relType="synonym"><wordstrings><wordstring>houndfish</
wordstring><wordstring>dachshund</wordstring><wordstring>Talbot</
wordstring><wordstring>Great Dane</wordstring><wordstring>limer</
wordstring><wordstring>incite</wordstring><wordstring>leash</
wordstring><wordstring>hound</wordstring><wordstring>drive</
wordstring><wordstring>hunt</wordstring></wordstrings></related></
relateds>


2. http://api.wordnik.com/api/word.xml/hound/related?type=synonym&count=25

<?xml version="1.0" encoding="UTF-8" standalone="yes"?
><relateds><related
relType="synonym"><wordstrings><wordstring>houndfish</
wordstring><wordstring>dachshund</wordstring><wordstring>Talbot</
wordstring><wordstring>Great Dane</wordstring><wordstring>limer</
wordstring><wordstring>incite</wordstring><wordstring>leash</
wordstring><wordstring>hound</wordstring><wordstring>drive</
wordstring><wordstring>hunt</wordstring><wordstring>bloodhound</
wordstring><wordstring>beagle</wordstring><wordstring>kibble</
wordstring><wordstring>dog</wordstring></wordstrings></related></
relateds>

Tony Tam

unread,
May 18, 2010, 3:40:41 PM5/18/10
to Wordnik API
Hi Michelle, currently we don't support a user-specified sort order,
but returning based on corpus frequency would be neat. I'll get that
on our list. The existing order is the natural order that the related
documents are returned from our database (mongodb) which is not really
meaningful in any context.

The API is actually ahead of the site right now--the site is using
older, stale data. So there is a chance that you won't see the same
responses between API and www.wordnik.com. The site update is
happening soon, so you'll be able to see the same data between the
two.

Tony

On May 18, 12:31 pm, Michelle <michellewald...@gmail.com> wrote:
> Hi Tony,
>
> We ran the call twice, first using the default count and then a count
> of 25.
>
> - What is the sort order of the response?  Can we specify the sort
> order?  (e.g. most frequently occurring synonym? )
>
> - And here's a weird result: When we use the default count,
> "houndfish" is the first synonym.  "houndfish" is not on the Wordnik
> site as a synonym for "hound".  Why would the API return a synonym
> that is not on the main site?  It looks like you are pulling your
> synonyms from Allen's in this case.
>
> Kindly advise,
>
> Michelle
>
> 1.http://api.wordnik.com/api/word.xml/hound/related?type=synonym
>
> <?xml version="1.0" encoding="UTF-8" standalone="yes"?><relateds><related
>
> relType="synonym"><wordstrings><wordstring>houndfish</
> wordstring><wordstring>dachshund</wordstring><wordstring>Talbot</
> wordstring><wordstring>Great Dane</wordstring><wordstring>limer</
> wordstring><wordstring>incite</wordstring><wordstring>leash</
> wordstring><wordstring>hound</wordstring><wordstring>drive</
> wordstring><wordstring>hunt</wordstring></wordstrings></related></
> relateds>
>
> 2.http://api.wordnik.com/api/word.xml/hound/related?type=synonym&count=25

Michelle

unread,
May 18, 2010, 3:56:38 PM5/18/10
to Wordnik API
Good info!

We're sorting the synonyms by corpus frequency on our side and caching
the results for now.

Michelle


On May 18, 2:40 pm, Tony Tam <feh...@gmail.com> wrote:
> Hi Michelle, currently we don't support a user-specified sort order,
> but returning based on corpus frequency would be neat.  I'll get that
> on our list.  The existing order is the natural order that the related
> documents are returned from our database (mongodb) which is not really
> meaningful in any context.
>
> The API is actually ahead of the site right now--the site is using
> older, stale data.  So there is a chance that you won't see the same
> responses between API andwww.wordnik.com.  The site update is

Tony Tam

unread,
May 19, 2010, 4:49:08 PM5/19/10
to Wordnik API
Hi Michelle (and others),
We recently increased the default # of related items from 10 to 100.
The old, smallish number was making some people crazy because the
selection of "which 10 to return" didn't follow general common sense,
whatever that is.

Tony

kflorence

unread,
May 20, 2010, 12:34:18 AM5/20/10
to Wordnik API
As I'm using this now, I have to make one query to this function, then
use the result of the verb-stem to make another query for a
definition. I'm wondering if it's possible to add this option to the
definition method by passing in a related-types parameter or something
similar? Would save some code and some server traffic, since I'm sure
it will be a commonly used feature. It would be especially sweet if
the definition returned an indication of what the relation to the
original word was. For example, if I were to query "closed" and the
definition for "close" was returned, the relationship would say
"Simple past tense and past participle of close."

Tony Tam

unread,
May 20, 2010, 12:58:32 PM5/20/10
to Wordnik API
Definitely on the short list to get done. The mechanism will
essentially leverage the suggester, which is used for the "did you
mean" on the website. That--plus incorporating verb stems in the DYM
logic--should really help ensure you get a definition back from the
API.

Tony

kflorence

unread,
May 20, 2010, 10:44:14 PM5/20/10
to Wordnik API
Excellent, I look forward to it :)
Reply all
Reply to author
Forward
0 new messages