mehran-sarmadi commited on
Commit
f708851
·
verified ·
1 Parent(s): 645e9e7

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +25 -18
README.md CHANGED
@@ -51,7 +51,7 @@
51
  ---
52
  # How to Use the Hakim Model
53
 
54
- You can interact with the Hakim model via our API. This API supports three different models: `Hakim`, `Hakim-small`, and `Hakim-unsup`. Below are the details on how to send requests and use the models.
55
 
56
  ## 1. Sending Requests Using `curl`
57
 
@@ -60,7 +60,7 @@ To send a request to the model using the `curl` command in your terminal, use th
60
  > **Note:** For quick testing, you can use `mcinext` as your API key. This will allow you to access the API with some limitations.
61
 
62
  ```bash
63
- curl -X POST 'http://your-server-address/api/embedding-model' \
64
  -H "Content-Type: application/json" \
65
  -H "Accept: application/json" \
66
  -H "Authorization: Bearer your_api_key" \
@@ -126,12 +126,31 @@ except Exception as err:
126
  print(f"An error occurred: {err}")
127
  ```
128
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
129
  3. Handling Special Tasks
130
- ### STS (Semantic Textual Similarity)
131
- For STS tasks, you need to compare the similarity between two pieces of text. You can send one or more sentences for comparison. To do this:
132
 
133
- 1. Send the first sentence(s) with the `sts.sent1` prompt type.
134
- 2. Send the second sentence(s) with the `sts.sent2` prompt type.
 
 
 
 
135
 
136
  Here’s how to do this:
137
 
@@ -212,18 +231,6 @@ For this, you provide both texts in a specific format:
212
  ```
213
 
214
  The model will process both pairs of texts, compute their embeddings, and then you can use these embeddings to train a model to categorize or classify them into predefined categories based on the similarity or relationship between the two texts.
215
- 4. Error Handling
216
- If the input is incorrect or the prompt type is invalid, the API will return a 400 Bad Request with a detailed error message. For example:
217
-
218
- ```json
219
- {
220
- "detail": "Invalid prompt_type provided. Valid options: sentiment, classification, sts.sent1, cross"
221
- }
222
- ```
223
- 5. Limitations and Notes
224
- Quick Testing: If you want to quickly test the API, use the API key mcinext. This will allow you to access the API with some limitations.
225
-
226
- Input Formatting: For tasks like "cross", the input should be formatted as "[text1]: <text1>, [text2]: <text2>". Make sure to properly structure the input text as required by the task to avoid errors.
227
 
228
  ## Citation
229
  ```bibtext
 
51
  ---
52
  # How to Use the Hakim Model
53
 
54
+ You can interact with the Hakim model through our API. This API supports three different models: Hakim, Hakim-small, and Hakim-unsup. Below are the details on how to send requests and use the models.
55
 
56
  ## 1. Sending Requests Using `curl`
57
 
 
60
  > **Note:** For quick testing, you can use `mcinext` as your API key. This will allow you to access the API with some limitations.
61
 
62
  ```bash
63
+ curl -X POST 'http://mcinext.ai/api/embedding-model' \
64
  -H "Content-Type: application/json" \
65
  -H "Accept: application/json" \
66
  -H "Authorization: Bearer your_api_key" \
 
126
  print(f"An error occurred: {err}")
127
  ```
128
 
129
+ 3. Supported Prompt Types
130
+ The prompt_type field is crucial for guiding the model to perform specific tasks. If you don't provide a prompt_type, the input will be sent to the model without any special prefixes, which is the default behavior. This is particularly useful for the Hakim-unsup model, which is designed for unsupervised tasks.
131
+
132
+ Here is a list of all supported prompt types and their uses:
133
+
134
+ | prompt\_type | Use Case | Preprocessed Example (in Farsi) |
135
+ | ----------------- | ------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------- |
136
+ | sentiment | Sentiment analysis of text. | مسئله : دسته بندی , تحلیل احساس رضایت متن \| متن : \[متن شما] |
137
+ | classification | General and topical text classification. | مسئله : دسته بندی , دسته بندی موضوعی متن \| متن : \[متن شما] |
138
+ | clustering | Text clustering and topical classification. | مسئله : دسته بندی , دسته بندی موضوعی متن \| متن : \[متن شما] |
139
+ | sts.sent1 | Semantic Textual Similarity (STS) for the first sentence. | مسئله : تشخیص ارتباط , آیا متن دوم شباهت معنایی با متن اول دارد ؟ \| متن اول : \[متن شما] |
140
+ | sts.sent2 | Semantic Textual Similarity (STS) for the second sentence. | مسئله : تشخیص ارتباط , آیا متن دوم شباهت معنایی با متن اول دارد ؟ \| متن دوم : \[متن شما] |
141
+ | retrieval.query | Information Retrieval (query text). | مسئله : تشخیص ارتباط , آیا متن دوم به متن اول مرتبط است ؟ \| متن اول : \[متن شما] |
142
+ | retrieval.passage | Information Retrieval (document text). | مسئله : تشخیص ارتباط , آیا متن دوم به متن اول مرتبط است ؟ \| متن دوم : \[متن شما] |
143
+ | cross | Classification with two inputs, determining semantic relationship. | مسئله : دسته بندی با دو ورودی , نوع ارتباط معنایی متن دوم با متن اول چگونه است ؟ \| متن اول : \[متن ۱] \| متن دوم : \[متن ۲] |
144
+
145
+
146
  3. Handling Special Tasks
 
 
147
 
148
+ STS (Semantic Textual Similarity)
149
+ For STS tasks, you need to compare the similarity between two pieces of text. You can send one or more sentences for comparison. Send the requests separately for comparison. To do this:
150
+
151
+ Send the first sentence(s) with the sts.sent1 prompt type.
152
+
153
+ Send the second sentence(s) with the sts.sent2 prompt type.
154
 
155
  Here’s how to do this:
156
 
 
231
  ```
232
 
233
  The model will process both pairs of texts, compute their embeddings, and then you can use these embeddings to train a model to categorize or classify them into predefined categories based on the similarity or relationship between the two texts.
 
 
 
 
 
 
 
 
 
 
 
 
234
 
235
  ## Citation
236
  ```bibtext