You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Inconsistently, but often enough to notice, chunks of a sentence will be flagged as a URL when they are not.
Example:
fromguardrailsimportGuardfromguardrails.hubimportCompetitorCheck, DetectPIIguard=Guard().use(
CompetitorCheck(
competitors=["Fortran", "Ada", "Pascal"],
on_fail="fix"
)
).use(DetectPII(pii_entities="pii", on_fail="fix"))
response=guard.validate("The author is Paul Graham. Growing up, he worked on writing short stories and programming, starting with an early version of Fortran on an IBM 1401 in 9th grade. Later, he transitioned to microcomputers and began programming more extensively, including writing simple games and a word processor on a TRS-80.")
print("Raw: ", response.raw_llm_output)
print("Guarded: ", response.validated_output)
Raw: The author is Paul Graham. Growing up, he worked on writing short stories and programming, starting with an early version of Fortran on an IBM 1401 in 9th grade. Later, he transitioned to microcomputers and began programming more extensively, including writing simple games and a word processor on a TRS-80.
Guarded: The author is <PERSON><URL>owing up, he worked on writing short stories and programming, starting with an early version of [COMPETITOR] on an IBM 1401 in 9th <URL>er, he transitioned to microcomputers and began programming more extensively, including writing simple games and a word processor on a TRS-80.
I'm guessing it may have to do with how the chunking removes spaces so it sees .[some three letters] and thinks it's a top level domain. For example turning 9th grade. Later, into 9th <URL>er, kind of makes sense because .lat is a known top level domain. However, the other assumably flagged tld is .gro which isn't a thing unless it's fuzzy matching to .org.
The text was updated successfully, but these errors were encountered:
Inconsistently, but often enough to notice, chunks of a sentence will be flagged as a URL when they are not.
Example:
I'm guessing it may have to do with how the chunking removes spaces so it sees
.[some three letters]
and thinks it's a top level domain. For example turning9th grade. Later,
into9th <URL>er,
kind of makes sense because.lat
is a known top level domain. However, the other assumably flagged tld is.gro
which isn't a thing unless it's fuzzy matching to.org
.The text was updated successfully, but these errors were encountered: