Custom Keyword Hashing
Custom keyword hashing gives you full flexibility to redact sensitive information by customizing keywords for your compliance or data privacy needs.
Use this feature while transcribing audio or processing text input.
Option 1: Keyword Hashing During Transcription
Request:
Don’t forget to replace YOUR_API_KEY with your own secret key.
import requests
url = "https://tb2.shunyalabs.ai/v1/transcriptions"
headers = {"X-API-Key": "your-api-key"}
with open("confidential_call.wav", "rb") as f:
files = {"file": f}
data = {
"hash_keywords": '["confidential", "internal", "project Phoenix", "budget"]'
}
response = requests.post(url, headers=headers, files=files, data=data)
print(response.json())Example Output:
{
"success": true,
"text": "Our #### project #### will launch next quarter with significant #### allocation",
"segments": [
{
"start": 0.0,
"end": 6.8,
"text": "Our #### project #### will launch next quarter with significant #### allocation",
"speaker": "SPEAKER_00"
}
]
}Option 2: Standalone Keyword Hashing
Parameters:
- text (String, required): Input text to process
- hash_keywords (String, required): JSON array of keywords to hash
Request:
Don’t forget to replace YOUR_API_KEY with your own secret key.
import requests
url = "https://tb.shunyalabs.ai/v1/hash"
headers = {"X-API-Key": "your-api-key"}
data = {
"text": "The patient's social security number is 123-45-6789 and credit card is 4532-6789-123-4567",
"hash_keywords": '["social security number", "123-45-6789", "credit card", "4532-1234"]'
}
response = requests.post(url, headers=headers, data=data)
print(response.json())Example Output:
{
"clean_text": "The patient's #### is #### and #### is ####"
}Use Cases for Custom Keyword Hashing
- Data Privacy (PII Redaction): Hash personal information like SSNs, credit cards, phone numbers
- Compliance: Meet HIPAA, GDPR, or industry-specific regulatory requirements
- Corporate Security: Redact confidential project names, budgets, or internal terminology
- Broadcast Media: Prepare content for regulated television or radio broadcasting
- Customer Service: Protect customer privacy in recorded support calls
- Legal Documentation: Sanitize sensitive information before sharing transcripts