|
1 |
| -# Get started with Cohere! |
| 1 | +# Cohere Cookbook |
2 | 2 |
|
3 |
| -This repo contains code examples and jupyter notebooks for you to get started with the Cohere Platform |
| 3 | +Welcome to the Cohere Cookbook! This repository provides a collection of examples to help you get started with the Cohere API. These examples contain step-by-step guides, with code examples and explanations, to help you understand and use the API effectively. |
4 | 4 |
|
5 |
| -### 1. Text Classification Using Embeddings |
| 5 | +# Getting Started |
| 6 | +The cookbook is grouped into a few categories. To get started, go to any of the categories below. You will find more details there, but here's a summary: |
6 | 7 |
|
7 |
| -Create a simple sentiment classifier using Cohere's embeddings: |
8 |
| -[<a href="https://github.com/cohere-ai/notebooks/blob/main/notebooks/Text_Classification_Using_Embeddings.ipynb">Notebook</a> | <a href="https://colab.research.google.com/github/cohere-ai/notebooks/blob/main/notebooks/Text_Classification_Using_Embeddings.ipynb">Colab</a>] |
9 |
| -<img src="https://raw.githubusercontent.com/cohere-ai/notebooks/67bfbe868ccfde25f903d3aacea5a1ffaebfdb42/notebooks/images/interim-notebook-visuals/text-classification-embeddings-interim.svg" style="width:100%; max-width:400px" alt="first we embed the text in the dataset, then we use that to train a classifier" /> |
10 |
| - |
11 |
| -### 2. Text Summarization |
12 |
| - |
13 |
| -Summarize or paraphrase text using Cohere's Generate endpoint. |
14 |
| -[<a href="https://github.com/cohere-ai/notebooks/blob/main/notebooks/Basic_Summarization_Notebook.ipynb">Notebook</a> | <a href="https://colab.research.google.com/github/cohere-ai/notebooks/blob/main/notebooks/Basic_Summarization_Notebook.ipynb">Colab</a>] |
15 |
| - |
16 |
| -<img src="https://raw.githubusercontent.com/cohere-ai/notebooks/67bfbe868ccfde25f903d3aacea5a1ffaebfdb42/notebooks/images/interim-notebook-visuals/summarization-interim.svg" style="width:100%; max-width:400px" alt="provided with the right prompt, a language model can generate multiple candidate summaries" /> |
17 |
| - |
18 |
| -### 3. Semantic Search |
19 |
| - |
20 |
| -Build search products that search by meaning and go beyond keyword matching. |
21 |
| -[<a href="https://github.com/cohere-ai/notebooks/blob/main/notebooks/Basic_Semantic_Search.ipynb">Notebook</a> | <a href="https://colab.research.google.com/github/cohere-ai/notebooks/blob/main/notebooks/Basic_Semantic_Search.ipynb">Colab</a>] |
22 |
| - |
23 |
| -<img src="https://raw.githubusercontent.com/cohere-ai/notebooks/67bfbe868ccfde25f903d3aacea5a1ffaebfdb42/notebooks/images/interim-notebook-visuals/semantic-search-interim.svg" style="width:100%; max-width:400px" alt="Use query and archive embeddings to retrieve relevant search results" /> |
24 |
| - |
25 |
| -### 4. Entity Extraction |
26 |
| - |
27 |
| -Extract name entities from text using only a few examples. |
28 |
| -[<a href="https://github.com/cohere-ai/notebooks/blob/main/notebooks/Entity_Extrcation_with_Generative_Language_Models.ipynb">Notebook</a> | <a href="https://colab.research.google.com/github/cohere-ai/notebooks/blob/main/notebooks/Entity_Extrcation_with_Generative_Language_Models.ipynb">Colab</a>] |
29 |
| - |
30 |
| -<img src="https://raw.githubusercontent.com/cohere-ai/notebooks/67bfbe868ccfde25f903d3aacea5a1ffaebfdb42/notebooks/images/interim-notebook-visuals/entity-extraction-interim.svg" style="width:100%; max-width:400px" alt="Extract name entities from text using only a few examples" /> |
31 |
| - |
32 |
| -### 5. Recommender System |
33 |
| - |
34 |
| -Recommend articles with via text embedding, classification, and extraction. |
35 |
| -[<a href="https://github.com/cohere-ai/notebooks/blob/main/notebooks/Article_Recommender_with_Text_Embedding_Classification_Extraction.ipynb">Notebook</a> | <a href="https://colab.research.google.com/github/cohere-ai/notebooks/blob/main/notebooks/Article_Recommender_with_Text_Embedding_Classification_Extraction.ipynb">Colab</a>] |
36 |
| - |
37 |
| -<img src="https://raw.githubusercontent.com/cohere-ai/notebooks/67bfbe868ccfde25f903d3aacea5a1ffaebfdb42/notebooks/images/interim-notebook-visuals/recommend-articles-interim.svg" style="width:100%; max-width:400px" alt="Article recommender with Embed, Classify, and Generate" /> |
38 |
| - |
39 |
| -### 6. Visualizing Text Embeddings |
40 |
| - |
41 |
| -Intuition behind text embeddings, what use cases they are good for, and how they can be customized using finetuning. |
42 |
| -[<a href="https://github.com/cohere-ai/notebooks/blob/main/notebooks/Visualizing_Text_Embeddings.ipynb">Notebook</a> | <a href="https://colab.research.google.com/github/cohere-ai/notebooks/blob/main/notebooks/Visualizing_Text_Embeddings.ipynb">Colab</a>] |
43 |
| - |
44 |
| -<img src="https://raw.githubusercontent.com/cohere-ai/notebooks/67bfbe868ccfde25f903d3aacea5a1ffaebfdb42/notebooks/images/interim-notebook-visuals/visualize-embed-interim.svg" style="width:100%; max-width:400px" alt="Visualizing Text Embeddings" /> |
45 |
| - |
46 |
| -### 7. Clustering Hacker News Posts |
47 |
| - |
48 |
| -Combing for insight in 10,000 Hacker News posts with text clustering |
49 |
| -[<a href="https://github.com/cohere-ai/notebooks/blob/main/notebooks/Analyzing_Hacker_News_with_Six_Language_Understanding_Methods.ipynb">Notebook</a> | <a href="https://colab.research.google.com/github/cohere-ai/notebooks/blob/main/notebooks/Analyzing_Hacker_News_with_Six_Language_Understanding_Methods.ipynb">Colab</a>] |
50 |
| - |
51 |
| -<img src="https://raw.githubusercontent.com/cohere-ai/notebooks/main/notebooks/images/Hacker-News-text-analysis-2.png" style="width:100%; max-width:400px" alt="Clustering Hacker News Posts" /> |
52 |
| - |
53 |
| -### 8. Hello World! Meet Language AI |
54 |
| - |
55 |
| -A quick tour of what’s possible with language AI via Cohere’s Large Language Model (LLM) API |
56 |
| -[<a href="https://github.com/cohere-ai/notebooks/blob/main/notebooks/Hello_World_Meet_Language_AI.ipynb">Notebook</a> | <a href="https://colab.research.google.com/github/cohere-ai/notebooks/blob/main/notebooks/Hello_World_Meet_Language_AI.ipynb">Colab</a>] |
57 |
| - |
58 |
| -<img src="https://raw.githubusercontent.com/cohere-ai/notebooks/main/notebooks/images/hello-world/hello-world-feat.png" style="width:100%; max-width:400px" alt="Hello World! Meet Language AI" /> |
59 |
| - |
60 |
| -### 9. Topic Modeling of AI Papers in 2022 |
61 |
| - |
62 |
| -Semantic search and clustering of papers in Journal of Artificial Intelligence Research |
63 |
| -[<a href="https://github.com/cohere-ai/notebooks/blob/main/notebooks/Topic_Modeling_AI_Papers.ipynb">Notebook</a> | <a href="https://colab.research.google.com/github/cohere-ai/notebooks/blob/main/notebooks/Topic_Modeling_AI_Papers.ipynb">Colab</a>] |
64 |
| - |
65 |
| -<img src="https://raw.githubusercontent.com/cohere-ai/notebooks/main/notebooks/images/topic_modeling_ai_papers.png" style="width:100%; max-width:400px" alt="Hello World! Meet Language AI" /> |
66 |
| - |
67 |
| -### 10. Three Ways to Build a Text Classifier with the Cohere API |
68 |
| - |
69 |
| -Helping you evaluate which of these options best suits your objectives |
70 |
| -[<a href="https://github.com/cohere-ai/notebooks/blob/main/notebooks/Topic_Modeling_AI_Papers.ipynb">Notebook</a> | <a href="https://colab.research.google.com/github/cohere-ai/notebooks/blob/main/notebooks/Three_Ways_to_Build_a_Text_Classifier_with_Cohere.ipynb">Colab</a>] |
71 |
| - |
72 |
| -<img src="https://raw.githubusercontent.com/cohere-ai/notebooks/main/notebooks/images/classify-three-options/classify-options-feat.png" style="width:100%; max-width:400px" alt="Hello World! Meet Language AI" /> |
73 |
| - |
74 |
| -### 11. Generating Stories with Generate and Stable Diffusion |
75 |
| -Describe your story in two sentences, then guide Cohere's language model as it turns it into a bigger story. |
76 |
| - |
77 |
| -[<a href="https://github.com/cohere-ai/notebooks/blob/main/notebooks/Generating_stories_with_LLMs_and_Stable_Diffusion.ipynb">Notebook</a> | <a href="https://colab.research.google.com/github/cohere-ai/notebooks/blob/main/notebooks/Generating_stories_with_LLMs_and_Stable_Diffusion.ipynb">Colab</a> | <a href="https://colab.research.google.com/github/cohere-ai/notebooks/blob/main/notebooks/Brainstorming_Story_Ideas_with_Cohere_and_Stable_Diffusion.ipynb">Colab - v2</a>] |
78 |
| - |
79 |
| -<img src="https://raw.githubusercontent.com/cohere-ai/notebooks/main/notebooks/images/story-generation-prompt-chaining.png" style="width:100%; max-width:400px" alt="Story Generation with Generate and Stable Diffusion" /> |
80 |
| - |
81 |
| -### 12. Working with the Generate Endpoint |
82 |
| -Explore the Generate endpoint, one of the endpoints available from the Cohere API. |
83 |
| -[<a href="https://github.com/cohere-ai/notebooks/blob/main/notebooks/Working_With_the_Generate_Endpoint.ipynb">Notebook</a> | <a href="https://colab.research.google.com/github/cohere-ai/notebooks/blob/main/notebooks/Working_With_the_Generate_Endpoint.ipynb">Colab</a>] |
84 |
| - |
85 |
| -<img src="https://raw.githubusercontent.com/cohere-ai/notebooks/main/notebooks/images/generative-ai-part3.png" style="width:100%; max-width:400px" alt="Working with the Generate Endpoint" /> |
86 |
| - |
87 |
| -### 13. Evaluating Custom Models |
88 |
| -Create a custom Generate model and evaluate the generation quality. |
89 |
| -[<a href="https://github.com/cohere-ai/notebooks/blob/main/notebooks/Evaluating_Custom_Models.ipynb">Notebook</a> | <a href="https://colab.research.google.com/github/cohere-ai/notebooks/blob/main/notebooks/Evaluating_Custom_Models.ipynb">Colab</a>] |
90 |
| - |
91 |
| -<img src="https://raw.githubusercontent.com/cohere-ai/notebooks/main/notebooks/images/generative-ai-part4.png" style="width:100%; max-width:400px" alt="Evaluating Custom Models" /> |
92 |
| - |
93 |
| -### 14. Multilingual Semantic Search with Cohere and Langchain |
94 |
| -Use Langchain to efficiently build semantic search applications on top of Cohere’s multilingual model. |
95 |
| -[<a href="https://github.com/cohere-ai/notebooks/blob/main/notebooks/Multilingual_Search_with_Cohere_and_Langchain.ipynb">Notebook</a> | <a href="https://colab.research.google.com/github/cohere-ai/notebooks/blob/main/notebooks/Multilingual_Search_with_Cohere_and_Langchain.ipynb">Colab</a>] |
96 |
| - |
97 |
| -<img src="https://raw.githubusercontent.com/cohere-ai/notebooks/main/notebooks/images/search-cohere-langchain.png" style="width:100%; max-width:400px" alt="Multilingual Semantic Search with Cohere and Langchain" /> |
98 |
| - |
99 |
| -### 15. Fueling Generative Content with Keyword Research |
100 |
| -Build a content idea generator that is backed by keyword research. |
101 |
| -[<a href="https://github.com/cohere-ai/notebooks/blob/main/notebooks/Fueling_Generative_Content_with_Keyword_Research.ipynb">Notebook</a> | <a href="https://colab.research.google.com/github/cohere-ai/notebooks/blob/main/notebooks/Fueling_Generative_Content_with_Keyword_Research.ipynb">Colab</a>] |
102 |
| - |
103 |
| -<img src="https://raw.githubusercontent.com/cohere-ai/notebooks/main/notebooks/images/fueling-generative-content.png" style="width:100%; max-width:400px" alt="Fueling Generative Content with Keyword Research" /> |
104 |
| - |
105 |
| -### 16. Command Model Use Case Patterns |
106 |
| -Understand the range of use cases that you can build with the Cohere Command model. |
107 |
| -[<a href="https://github.com/cohere-ai/notebooks/blob/main/notebooks/Command_Model_Use_Case_Patterns.ipynb">Notebook</a> | <a href="https://colab.research.google.com/github/cohere-ai/notebooks/blob/main/notebooks/Command_Model_Use_Case_Patterns.ipynb">Colab</a>] |
108 |
| - |
109 |
| -<img src="https://raw.githubusercontent.com/cohere-ai/notebooks/main/notebooks/images/command-usecase-patterns.png" style="width:100%; max-width:400px" alt="Command Model Use Case Patterns" /> |
110 |
| - |
111 |
| -### 17. Constructing Prompts for the Command Model |
112 |
| -Tips and ideas for constructing prompts for the Command Model |
113 |
| -[<a href="https://github.com/cohere-ai/notebooks/blob/main/notebooks/Constructing_Prompt_Commands.ipynb">Notebook</a> | <a href="https://colab.research.google.com/github/cohere-ai/notebooks/blob/main/notebooks/Constructing_Prompt_Commands.ipynb">Colab</a>] |
114 |
| - |
115 |
| -<img src="https://raw.githubusercontent.com/cohere-ai/notebooks/main/notebooks/images/constructing-prompts.png" style="width:100%; max-width:400px" alt="Constructing Prompts for the Command Model" /> |
116 |
| - |
117 |
| -### 18. Validating Large Language Model Outputs |
118 |
| -We look at what output validation is and how to implement it using Guardrails AI. |
119 |
| -[<a href="https://github.com/cohere-ai/notebooks/blob/main/notebooks/Validating_Large_Language_Model_Outputs.ipynb">Notebook</a> | <a href="https://colab.research.google.com/github/cohere-ai/notebooks/blob/main/notebooks/Validating_Large_Language_Model_Outputs.ipynb">Colab</a>] |
120 |
| - |
121 |
| -<img src="https://raw.githubusercontent.com/cohere-ai/notebooks/main/notebooks/images/validating-llm-outputs.png" style="width:100%; max-width:400px" alt="Validating Large Language Model Outputs |
122 |
| -" /> |
123 |
| - |
124 |
| - |
125 |
| -### 19. Question Answering Via SageMaker JumpStart |
126 |
| -Question Answering using LangChain and Cohere's Generate and Embedding Models from SageMaker JumpStart |
127 |
| -[<a href="https://github.com/cohere-ai/notebooks/blob/main/notebooks/QuestionAnwering_Cohere_SagemakerJumpstart.ipynb">Notebook</a> | <a href="https://colab.research.google.com/github/cohere-ai/notebooks/blob/main/notebooks/QuestionAnwering_Cohere_SagemakerJumpstart.ipynb">Colab</a>] |
128 |
| - |
129 |
| - |
130 |
| - |
131 |
| -### 20. How to Build a Chatbot with the Chat Endpoint |
132 |
| -Learn how to build a chatbot using Cohere’s Chat endpoint. |
133 |
| -[<a href="https://github.com/cohere-ai/notebooks/blob/main/notebooks/How_to_Build_a_Chatbot_with_the_Chat_Endpoint.ipynb |
134 |
| -">Notebook</a> | <a href="https://colab.research.google.com/github/cohere-ai/notebooks/blob/main/notebooks/How_to_Build_a_Chatbot_with_the_Chat_Endpoint.ipynb |
135 |
| -">Colab</a>] |
136 |
| - |
137 |
| -<img src="https://raw.githubusercontent.com/cohere-ai/notebooks/main/notebooks/images/chatbot-chat-endpoint.png" style="width:100%; max-width:400px" alt="How to Build a Chatbot with the Chat Endpoint" /> |
138 |
| - |
139 |
| -### 21. How to Build a RAG-Powered Chatbot with Chat, Embed, and Rerank |
140 |
| -Learn how to build a chatbot using Cohere’s Chat, Embed, and Rerank endpoints. |
141 |
| -[<a href="https://github.com/cohere-ai/notebooks/blob/main/notebooks/RAG_Chatbot_with_Chat_Embed_Rerank.ipynb |
142 |
| -">Notebook</a> | <a href="https://colab.research.google.com/github/cohere-ai/notebooks/blob/main/notebooks/RAG_Chatbot_with_Chat_Embed_Rerank.ipynb |
143 |
| -">Colab</a>] |
144 |
| - |
145 |
| -<img src="https://raw.githubusercontent.com/cohere-ai/notebooks/main/notebooks/images/rag-chatbot.png" style="width:100%; max-width:400px" alt="How to Build a RAG-Powered Chatbot with Chat, Embed, and Rerank" /> |
146 |
| - |
147 |
| -### 22. How to Build a RAG-Powered Chatbot with Connectors |
148 |
| -Learn how to build a chatbot connectors using Cohere's build-your-own connectors framework. |
149 |
| -[<a href="https://github.com/cohere-ai/notebooks/blob/main/examples/chat_rag_connector/RAG_Chatbot_with_Connectors.ipynb |
150 |
| -">Notebook</a> | <a href="https://colab.research.google.com/github/cohere-ai/notebooks/blob/main/examples/chat_rag_connector/RAG_Chatbot_with_Connectors.ipynb |
151 |
| -">Colab</a>] |
152 |
| - |
153 |
| -<img src="https://raw.githubusercontent.com/cohere-ai/notebooks/main/notebooks/images/rag-chatbot-connector.png" style="width:100%; max-width:400px" alt="How to Build a RAG-Powered Chatbot with Connectors" /> |
154 |
| - |
155 |
| -### 23. How to Fine-Tune a Model for Cohere Chat |
156 |
| -[<a href="https://github.com/cohere-ai/notebooks/blob/main/notebooks/Fine_tuning_Models_for_the_Chat_Endpoint.ipynb |
157 |
| -">Notebook</a> | <a href="https://colab.research.google.com/github/cohere-ai/notebooks/blob/main/notebooks/Fine_tuning_Models_for_the_Chat_Endpoint.ipynb |
158 |
| -">Colab</a>] |
159 |
| - |
160 |
| -<img src="https://raw.githubusercontent.com/cohere-ai/notebooks/main/notebooks/images/chat-finetune.png" style="width:100%; max-width:400px" alt="How to Fine-Tune a Model for Cohere Chat" /> |
| 8 | +| Category | Description | |
| 9 | +| --- | --- | |
| 10 | +| [Guides](notebooks/guides/) | Tutorials and step-by-step guides covering a range of topics, providing practical guidance and code examples. |
| 11 | +| [LLM University](notebooks/llmu/) | Guides for getting started with Cohere, starting with basic usage and progressing to advanced topics. The code companion to the full [LLM University course](https://llm.university/).| |
| 12 | +| Enterprise (Coming soon) | Guides and best practices for deploying LLMs in an enterprise setting. Curated from real client engagements, offering insights and solutions for businesses.| |
0 commit comments