classify
Discover insights and patterns in your text
Classify organizes information for more effective content moderation, analysis, and chatbot experiences.
classify
Discover insights and patterns in your text
Classify organizes information for more effective content moderation, analysis, and chatbot experiences.
classify
Discover insights and patterns in your text
Classify organizes information for more effective content moderation, analysis, and chatbot experiences.
Our Customers
What's possible with Classify
Customer support tagging
Sentiment analysis
Content moderation
Classify text with just a few examples
No matter your level of experience with ML/AI, the Cohere Platform makes it easy to classify text in your applications.
1import cohere
2from cohere import ClassifyExample
3co = cohere.Client('{apiKey}')
4response = co.classify(
5 model='embed-english-v2.0',
6 inputs=["This item was broken when it arrived", "This item broke after 3 weeks"],
7 examples=[Example("The order came 5 days early", "positive"), Example("The item exceeded my expectations", "positive"), Example("I ordered more for my friends", "positive"), Example("I would buy this again", "positive"), Example("I would recommend this to others", "positive"), Example("The package was damaged", "negative"), Example("The order is 5 days late", "negative"), Example("The order was incorrect", "negative"), Example("I want to return my item", "negative"), Example("The item\'s material feels low quality", "negative")])
8print('The confidence levels of the labels are: {}'.format(response.classifications))
1{
2 "classifications":[
3 {
4 "input":"This item was broken when it arrived",
5 "prediction":"negative",
6 "confidence":0.9956072,
7 "confidences":[
8 {
9 "option":"positive",
10 "confidence":0.0043928297
11 },
12 {
13 "option":"negative",
14 "confidence":0.9956072
15 }
16 ],
17 "labels":{
18 "negative":{
19 "confidence":0.9956072
20 },
21 "positive":{
22 "confidence":0.0043928297
23 }
24 }
25 },
26 {
27 "input":"This item broke after 3 weeks",
28 "prediction":"negative",
29 "confidence":0.9345512,
30 "confidences":[
31 {
32 "option":"positive",
33 "confidence":0.06544881
34 },
35 {
36 "option":"negative",
37 "confidence":0.9345512
38 }
39 ],
40 "labels":{
41 "negative":{
42 "confidence":0.9345512
43 },
44 "positive":{
45 "confidence":0.06544881
46 }
47 }
48 }
49 ]
50}
Why Classify
Integrate large language models into your builds
Our API can be used in different libraries that fit every stack. We make it easy to build machine learning into your apps with our SDKs. Our API allows you to leverage classifiers on top of large language models without the need for additional training or hosting.
Multiple platform support
Cohere works with all common languages through native SDK support or encapsulated REST calls.
World-class models
Our large language models have been trained on billions of words, allowing them to understand nuance and context.
Integrate large language models into your builds
Our API can be used in different libraries that fit every stack. We make it easy to build machine learning into your apps with our SDKs. Our API allows you to leverage classifiers on top of large language models without the need for additional training or hosting.
Multiple platform support
Cohere works with all common languages through native SDK support or encapsulated REST calls.
World-class models
Our large language models have been trained on billions of words, allowing them to understand nuance and context.
Classify resources
No need to know ML or AI — try Cohere now!
Get started with Cohere today!