Skip to content
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
| --- | --- |
| Date of development | Feb 15, 2024 |
| Validator type | Format |
| Blog | - |
| Blog | |
| License | Apache 2 |
| Input/Output | Output |

Expand All @@ -13,12 +13,17 @@
This validator validates the "cleanliness" of the text generated by a language model. It uses a pre-trained model to determine if the text is coherent and not gibberish. The validator can be used to filter out text that is not coherent or does not make sense.

## Requirements
- Dependencies: `nltk`, `transformers`, `torch`

* Dependencies:
- guardrails-ai>=0.4.0
- `nltk`
- `transformers`
- `torch`

## Installation

```bash
guardrails hub install hub://guardrails/gibberish_text
$ guardrails hub install hub://guardrails/gibberish_text
```

## Usage Examples
Expand Down Expand Up @@ -59,7 +64,7 @@ Validation failed for field with errors: The following sentences in your respons
```
**Note: See how only the first 2 sentences within the failing response are considered gibberish.**

## API Reference
# API Reference

**`__init__(self, threshold=0.5, validation_method='sentence', on_fail="noop")`**
<ul>
Expand Down