Skip to content

Commit

Permalink
Add spam classify
Browse files Browse the repository at this point in the history
  • Loading branch information
valeriansaliou committed Dec 6, 2024
1 parent 408265d commit 1f4376e
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
38 changes: 38 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,44 @@ client.task.fraud_spamicity({
}
```

#### ➡️ Spam Classify

* **Method:** `client.task.spam_classify(data)`
* **Reference:** [Spam Classify](https://docs.mirage-ai.com/references/api/v1/#spam-classify)

* **Request:**

```python
client.task.spam_classify({
"sender": {
"name": "John Doe",
"email": "john@example.com"
},

"transcript": [
{
"from": "customer",
"origin": "chat",
"text": "Hello, I would like to discuss your services"
}
]
});
```

* **Response:**

```json
{
"reason": "processed",

"data": {
"class": "spam",
"confidence": 0.13,
"logprob": -0.10
}
}
```

### Data API

#### ➡️ Context Ingest
Expand Down
3 changes: 3 additions & 0 deletions mirage_api/resources/task.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,6 @@ def translate_text(self, data):

def fraud_spamicity(self, data):
return self.parent.post("/task/fraud/spamicity", data)

def spam_classify(self, data):
return self.parent.post("/task/spam/classify", data)

0 comments on commit 1f4376e

Please sign in to comment.