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

Examples

Here are some examples of text clustering using MeaningCloud's 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 -XPOST "https://api.meaningcloud.com/clustering-1.1?key=<<YOUR OWN KEY>>&of=json&lang=en&txt=He%20earns%20%24200%2C000%2Fyr%20and%20still%20has%20a%20mortgage%20on%20his%20house%20%3A(%0AZara%20clothes%20will%20be%20the%20death%20of%20my%20credit%20card%0AMy%20bank%20insisted%20I%20destroyed%20my%20credit%20card%20before%20I%20could%20get%20a%20mortgage%0AI%27m%20not%20paying%20the%20mortgage%20or%20credit%20card%20bills%0ATell%20them%20you%27ve%20never%20had%20a%20loan%2C%20you%20have%20no%20mortgage&id=text01%0Atext02%0Atext03%0Atext04%0Atext05"
MeaningCloud API output
{
  "status": {
    "code": "0",
    "msg": "OK",
    "credits": "1"
  },
  "cluster_list": [
    {
      "title": "Credit Card",
      "size": "3",
      "score": "1.63",
      "document_list": {
        "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"
      }
    },
    {
      "title": "Mortgage",
      "size": "4",
      "score": "0.11",
      "document_list": {
        "text01": "He earns $200,000/yr and still has a mortgage on his house :(",
        "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"
      }
    }
  ]
}
        

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 -XPOST "https://api.meaningcloud.com/clustering-1.1?key=<>&of=json&lang=en&txt=I%20got%20the%20Barclay%20card%20for%20two%20reasons.%20One%20to%20help%20rebuild%20my%20credit%20and%20two%20to%20help%20me%20move%20my%20family%20to%20Alaska%2C%20if%20I%20needed%20it.%20I%20had%20received%20several%20offers%20from%20them%20in%20the%20mail%20and%20was%20not%20going%20to%20apply%20for%20the%20card%2C%20then%20decided%20that%20I%20would%20just%20in%20case%20I%20needed%20the%20card%20on%20our%20way.%20I%20had%20lost%20my%20job%20in%20the%20state%20I%20was%20in%20and%20by%20the%20grace%20of%20God%20only%20been%20out%20of%20work%20for%20two%20months.%20Yes%2C%20I%20had%20fallen%20behind%20on%20my%20vehicle%20payment%2C%20but%20was%20still%20approved%20for%20a%20%242k%20credit%20limit%20with%20Barclay.%20I%20ended%20up%20using%20the%20card%20on%20the%20travels.%20I%20got%20the%20family%20all%20situated%20and%20all%20the%20bills%20caught%20up%20in%20about%20a%20month%20and%20a%20half%20at%20the%20new%20job.%0AMy%20former%20bookkeeper%20paid%20her%20husband%27s%20credit%20card%20out%20of%20my%20business%20checking%20account.%20When%20I%20called%20the%20fraud%20department%20of%20Barclay%20Credit%20Cards%20they%20told%20me%20it%20was%20not%20their%20problem.%20They%20told%20me%20to%20contact%20the%20policy%20%26%20my%20bank.%20Both%20of%20which%20I%20have%20done.%20They%20said%20since%20she%20had%20access%20to%20my%20bank%20account%20numbers%20(almost%20all%20bookkeepers%20have%20this%20information)%20it%20was%20not%20their%20problem.%20When%20I%20asked%20to%20speak%20to%20someone%20who%20could%20explain%20to%20me%20why%20that%20person%20could%20take%20money%20out%20of%20an%20account%20that%20was%20not%20theirs%20they%20said%20as%20long%20as%20she%20had%20the%20number%20it%20was%20not%20their%20problem.%20I%20told%20them%20that%20they%20were%20going%20to%20be%20out%20money%20as%20I%20was%20able%20to%20cancel%20the%20last%202%20payments%20%26%20that%20I%20think%20they%20had%20a%20problem%20they%20just%20did%20not%20seem%20to%20care.%20The%20agent%20would%20not%20even%20give%20me%20his%20name%20as%20I%20did%20not%20have%20an%20account%20with%20them.%0AI%20have%20had%20my%20Barclays%20card%20for%20a%20couple%20years%20now%20and%20I%20originally%20got%20it%20because%20I%20am%20a%20college%20student%20and%20I%20needed%20a%20new%20computer.%20I%20was%20given%20a%20credit%20limit%20of%20%242%2C500.%20It%20has%20not%20changed%20for%20the%20past%202-3%20years%20I%27ve%20had%20this%20card.%20I%20ended%20up%20getting%20laid%20off%20but%20I%20was%20still%20making%20payments%20even%20if%20it%20was%20just%20the%20minimum%20payments.%20I%20am%20trying%20to%20raise%20my%20credit%20score%20and%20recently%20I%20have%20been%20able%20to%20put%20more%20into%20my%20payments%20so%20I%20started%20paying%20it%20down.%20I%20used%20part%20of%20a%20school%20loan%20and%20paid%20it%20down%20by%20half.%20It%20was%20nice%20to%20see%20I%20had%20over%20%241000%20available%20to%20me%20if%20I%20needed%20it."
MeaningCloud API output
{
    "status": {
        "code": "0",
        "msg": "OK",
        "credits": "3"
    },
    "cluster_list": [{
        "title": "Credit Limit",
        "size": "2",
        "score": "1.04",
        "document_list": {
            "1": "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.",
            "3": "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."
        }
    },
    {
        "title": "Paid",
        "size": "2",
        "score": "0.83",
        "document_list": {
            "2": "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.",
            "3": "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."
        }
    }]
}