Do you have any questions? Write us an email or ask us through the feedback section.

Examples

Here are some examples of text categorization using MeaningCloud API:

Find the clusters of a group of texts using our own identifiers

Find the clusters of a series of texts using their own identifiers:


"text01": "He earns $200,000/yr and still has a mortgage on his house :("


"text02": "Zara clothes will be the death of my credit card"


"text03": "My bank insisted I destroyed my credit card before I could get a mortgage"


"text04": "I'm not paying the mortgage or credit card bills"


"text05": "Tell them you've never had a loan, you have no mortgage"

  • Select value en as the value for the lang parameter to indicate we will be working with texts in English
  • Include your MeaningCloud license key as value for key parameter
  • Choose an output format, for instance json as value for of
  • Use the txt parameter to submit the texts.
  • Use the id parameter to submit the corresponding IDs.
Example using curl:
curl 'https://api.meaningcloud.com/clustering-1.1' \
  --form 'key=YOUR API KEY' \
  --form 'of=json' \
  --form 'lang=en' \
  --form $'txt=He earns $200,000/yr and still has a mortgage on his house :(\nZara clothes will be the death of my credit card\nMy bank insisted I destroyed my credit card before I could get a mortgage\nI\'m not paying the mortgage or credit card bills\nTell them you\'ve never had a loan, you have no mortgage' \
  --form $'id=text01\ntext02\ntext03\ntext04\ntext05'
MeaningCloud API output:
{
"status":{
"code":
"0"
"msg":
"OK"
"credits":
"1"
}
"cluster_list":[
0:{
"title":
"Credit Card"
"size":
"3"
"score":
"1.63"
"document_list":{
...
}
}
1:{
"title":
"Mortgage"
"size":
"4"
"score":
"0.11"
"document_list":{
...
}
}
]
}

Obtain the clustering for a group of texts

To obtain the clusters for a series of texts, we will use the following:

"I got the Barclay card for two reasons. One to help rebuild my credit and two to help me move my family to Alaska, if I needed it. I had received several offers from them in the mail and was not going to apply for the card, then decided that I would just in case I needed the card on our way. I had lost my job in the state I was in and by the grace of God only been out of work for two months. Yes, I had fallen behind on my vehicle payment, but was still approved for a $2k credit limit with Barclay. I ended up using the card on the travels. I got the family all situated and all the bills caught up in about a month and a half at the new job."

"My former bookkeeper paid her husband's credit card out of my business checking account. When I called the fraud department of Barclay Credit Cards they told me it was not their problem. They told me to contact the policy & my bank. Both of which I have done. They said since she had access to my bank account numbers (almost all bookkeepers have this information) it was not their problem. When I asked to speak to someone who could explain to me why that person could take money out of an account that was not theirs they said as long as she had the number it was not their problem. I told them that they were going to be out money as I was able to cancel the last 2 payments & that I think they had a problem they just did not seem to care. The agent would not even give me his name as I did not have an account with them."

"I have had my Barclays card for a couple years now and I originally got it because I am a college student and I needed a new computer. I was given a credit limit of $2,500. It has not changed for the past 2-3 years I've had this card. I ended up getting laid off but I was still making payments even if it was just the minimum payments. I am trying to raise my credit score and recently I have been able to put more into my payments so I started paying it down. I used part of a school loan and paid it down by half. It was nice to see I had over $1000 available to me if I needed it."

  • Use the txt parameter to submit the texts.
  • Select value en as the value for the lang parameter to indicate we will be working with texts in English
  • Include your MeaningCloud license key as value for key parameter
  • Choose an output format, for instance json as value for of

Example using curl

curl 'https://api.meaningcloud.com/clustering-1.1' \
  --form 'key=YOUR API KEY' \
  --form 'lang=YOUR LANG HERE' \
  --form 'txt=YOUR TEXTS HERE'
MeaningCloud API output
{
"status":{
"code":
"0"
"msg":
"OK"
"credits":
"3"
}
"cluster_list":[
0:{
"title":
"Credit Limit"
"size":
"2"
"score":
"1.04"
"document_list":{
...
}
}
1:{
"title":
"Paid"
"size":
"2"
"score":
"0.83"
"document_list":{
...
}
}
]
}