Skip to content

Commit ca9bd8e

Browse files
authored
Add new values for EntityType (#71)
1 parent 743b15b commit ca9bd8e

File tree

2 files changed

+92
-50
lines changed

2 files changed

+92
-50
lines changed

assemblyai/types.py

Lines changed: 91 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -211,114 +211,156 @@ class EntityType(str, Enum):
211211
"""
212212
Used for AssemblyAI's Entity Detection feature.
213213
214-
See: https://www.assemblyai.com/docs/audio-intelligence#entity-detection
214+
See: https://www.assemblyai.com/docs/audio-intelligence/entity-detection
215215
"""
216216

217-
medical_process = "medical_process"
218-
"Medical process, including treatments, procedures, and tests (e.g., heart surgery, CT scan)"
217+
account_number = "account_number"
218+
"Customer account or membership identification number (e.g., Policy No. 10042992; Member ID: HZ-5235-001)"
219219

220-
medical_condition = "medical_condition"
221-
"Name of a medical condition, disease, syndrome, deficit, or disorder (e.g., chronic fatigue syndrome, arrhythmia, depression)"
220+
banking_information = "banking_information"
221+
"Banking information, including account and routing numbers (e.g., Acct. No.: 012345-67)"
222222

223223
blood_type = "blood_type"
224224
"Blood type (e.g., O-, AB positive)"
225225

226-
drug = "drug"
227-
"Medications, vitamins, or supplements (e.g., Advil, Acetaminophen, Panadol)"
226+
credit_card_cvv = "credit_card_cvv"
227+
"Credit card verification code (e.g., CVV: 080)"
228228

229-
injury = "injury"
230-
"Bodily injury (e.g., I broke my arm, I have a sprained wrist)"
229+
credit_card_expiration = "credit_card_expiration"
230+
"Expiration date of a credit card (e.g., Expires: July 2023; Exp: 02/28)"
231231

232-
number_sequence = "number_sequence"
233-
"A 'lazy' rule that will redact any sequence of numbers equal to or greater than 2"
232+
credit_card_number = "credit_card_number"
233+
"Credit card number (e.g., 0123 0123 0123 0123)"
234234

235-
email_address = "email_address"
236-
"Email address (e.g., [email protected])"
235+
date = "date"
236+
"Specific calendar date (e.g., December 18)"
237+
238+
date_interval = "date_interval"
239+
"Broader time periods, including date ranges, months, seasons, years, and decades (e.g., 2020-2021; 5-9 May; January 1984 )"
237240

238241
date_of_birth = "date_of_birth"
239242
"Date of Birth (e.g., Date of Birth: March 7,1961)"
240243

241-
phone_number = "phone_number"
242-
"Telephone or fax number"
244+
drivers_license = "drivers_license"
245+
"Driver's license number (e.g., DL# 356933-540)"
243246

244-
us_social_security_number = "us_social_security_number"
245-
"Social Security Number or equivalent"
247+
drug = "drug"
248+
"Medications, vitamins, or supplements (e.g., Advil, Acetaminophen, Panadol)"
246249

247-
credit_card_number = "credit_card_number"
248-
"Credit card number"
250+
duration = "duration"
251+
"Periods of time, specified as a number and a unit of time (e.g., 8 months; 2 years)"
249252

250-
credit_card_expiration = "credit_card_expiration"
251-
"Expiration date of a credit card"
253+
email_address = "email_address"
254+
"Email address (e.g., [email protected])"
252255

253-
credit_card_cvv = "credit_card_cvv"
254-
"Credit card verification code (e.g., CVV: 080)"
256+
event = "event"
257+
"Name of an event or holiday (e.g., Olympics, Yom Kippur)"
255258

256-
date = "date"
257-
"Specific calendar date (e.g., December 18)"
259+
filename = "filename"
260+
"Names of computer files, including the extension or filepath (e.g., Taxes/2012/brad-tax-returns.pdf)"
258261

259-
nationality = "nationality"
260-
"Terms indicating nationality, ethnicity, or race (e.g., American, Asian, Caucasian)"
262+
gender_sexuality = "gender_sexuality"
263+
"Terms indicating gender identity or sexual orientation, including slang terms (e.g., female; bisexual; trans)"
261264

262-
event = "event"
263-
"Name of an event or holiday (e.g., Olympics, Yom Kippur)"
265+
healthcare_number = "healthcare_number"
266+
"Healthcare numbers and health plan beneficiary numbers (e.g., Policy No.: 5584-486-674-YM)"
267+
268+
injury = "injury"
269+
"Bodily injury (e.g., I broke my arm, I have a sprained wrist)"
270+
271+
ip_address = "ip_address"
272+
"Internet IP address, including IPv4 and IPv6 formats (e.g., 192.168.0.1)"
264273

265274
language = "language"
266275
"Name of a natural language (e.g., Spanish, French)"
267276

268277
location = "location"
269-
"Any Location reference including mailing address, postal code, city, state, province, or country"
278+
"Any Location reference including mailing address, postal code, city, state, province, country, or coordinates (e.g., Lake Victoria, 145 Windsor St., 90210)"
279+
280+
marital_status = "marital_status"
281+
"Terms indicating marital status (e.g., Single, common-law, ex-wife, married)"
282+
283+
medical_condition = "medical_condition"
284+
"Name of a medical condition, disease, syndrome, deficit, or disorder (e.g., chronic fatigue syndrome, arrhythmia, depression)"
285+
286+
medical_process = "medical_process"
287+
"Medical process, including treatments, procedures, and tests (e.g., heart surgery, CT scan)"
270288

271289
money_amount = "money_amount"
272290
"Name and/or amount of currency (e.g., 15 pesos, $94.50)"
273291

274-
person_name = "person_name"
275-
"Name of a person (e.g., Bob, Doug Jones)"
292+
nationality = "nationality"
293+
"Terms indicating nationality, ethnicity, or race (e.g., American, Asian, Caucasian)"
294+
295+
number_sequence = "number_sequence"
296+
"Numerical PII (including alphanumeric strings) that doesn't fall under other categories"
297+
298+
occupation = "occupation"
299+
"Job title or profession (e.g., professor, actors, engineer, CPA)"
300+
301+
organization = "organization"
302+
"Name of an organization (e.g., CNN, McDonalds, University of Alaska, Northwest General Hospital)"
303+
304+
passport_number = "passport_number"
305+
"Passport numbers, issued by any country (e.g., PA4568332; NU3C6L86S12)"
306+
307+
password = "password"
308+
"Account passwords, PINs, access keys, or verification answers (e.g., 27%alfalfa, temp1234, My mother's maiden name is Smith)"
276309

277310
person_age = "person_age"
278311
"Number associated with an age (e.g., 27, 75)"
279312

280-
organization = "organization"
281-
"Name of an organization (e.g., CNN, McDonalds, University of Alaska)"
313+
person_name = "person_name"
314+
"Name of a person (e.g., Bob, Doug Jones, Dr. Kay Martinez, MD)"
315+
316+
phone_number = "phone_number"
317+
"Telephone or fax number (e.g., +4917643476050)"
318+
319+
physical_attribute = "physical_attribute"
320+
"Distinctive bodily attributes, including terms indicating race (e.g., I'm 190cm tall, He has black hair)"
282321

283322
political_affiliation = "political_affiliation"
284323
"Terms referring to a political party, movement, or ideology (e.g., Republican, Liberal)"
285324

286-
occupation = "occupation"
287-
"Job title or profession (e.g., professor, actors, engineer, CPA)"
288-
289325
religion = "religion"
290326
"Terms indicating religious affiliation (e.g., Hindu, Catholic)"
291327

292-
drivers_license = "drivers_license"
293-
"Driver’s license number (e.g., DL# 356933-540)"
294-
295-
banking_information = "banking_information"
296-
"Banking information, including account and routing numbers"
328+
statistics = "statistics"
329+
"Medical statistics (e.g., 18%, 18 percent)"
297330

298331
time = "time"
299332
"Expressions indicating clock times (e.g., 19:37:28, 10pm EST)"
300333

301334
url = "url"
302335
"Internet addresses (e.g., www.assemblyai.com)"
303336

304-
password = "password"
305-
"Account passwords, PINs, access keys, or verification answers (e.g., 27%alfalfa, temp1234, My mother's maiden name is Smith)"
337+
us_social_security_number = "us_social_security_number"
338+
"Social Security Number or equivalent (e.g., 078-05-1120, ***-***-3256)"
339+
340+
username = "username"
341+
"Usernames, login names, or handles (e.g., @AssemblyAI)"
342+
343+
vehicle_id = "vehicle_id"
344+
"Vehicle identification numbers (VINs), vehicle serial numbers, and license plate numbers (e.g., 5FNRL38918B111818, BIF7547)"
345+
346+
zodiac_sign = "zodiac_sign"
347+
"Names of Zodiac signs (e.g., Aries, Taurus)"
306348

307349

308350
# EntityType and PIIRedactionPolicy share the same values
309351
PIIRedactionPolicy = EntityType
310352
"""
311353
Used for AssemblyAI's PII Redaction feature.
312354
313-
See: https://www.assemblyai.com/docs/audio-intelligence#pii-redaction
355+
See: https://www.assemblyai.com/docs/audio-intelligence/pii-redaction
314356
"""
315357

316358

317359
class PIISubstitutionPolicy(str, Enum):
318360
"""
319361
Used for AssemblyAI's PII Redaction feature.
320362
321-
See: https://www.assemblyai.com/docs/audio-intelligence#customize-how-redacted-pii-is-transcribed
363+
See: https://www.assemblyai.com/docs/audio-intelligence/pii-redaction
322364
"""
323365

324366
hash = "hash"
@@ -332,7 +374,7 @@ class SummarizationModel(str, Enum):
332374
"""
333375
Used for AssemblyAI's Summarization feature.
334376
335-
See: https://www.assemblyai.com/docs/audio-intelligence#summarization
377+
See: https://www.assemblyai.com/docs/audio-intelligence/summarization
336378
"""
337379

338380
informative = "informative"
@@ -384,7 +426,7 @@ class SummarizationType(str, Enum):
384426
"""
385427
Used for AssemblyAI's Summarization feature.
386428
387-
See: https://www.assemblyai.com/docs/audio-intelligence#summarization
429+
See: https://www.assemblyai.com/docs/audio-intelligence/summarization
388430
"""
389431

390432
bullets = "bullets"
@@ -460,7 +502,7 @@ class RawTranscriptionConfig(BaseModel):
460502
redact_pii_audio: Optional[bool]
461503
"Generate a copy of the original media file with spoken PII 'beeped' out."
462504
redact_pii_audio_quality: Optional[PIIRedactedAudioQuality]
463-
"The quality of the redacted audio file in case `redact_pii_audio` is enabled."
505+
"The quality of the redacted audio file in case `redact_pii_audio` is enabled."
464506
redact_pii_policies: Optional[List[PIIRedactionPolicy]]
465507
"The list of PII Redaction policies to enable."
466508
redact_pii_sub: Optional[PIISubstitutionPolicy]

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
setup(
99
name="assemblyai",
10-
version="0.26.0",
10+
version="0.27.0",
1111
description="AssemblyAI Python SDK",
1212
author="AssemblyAI",
1313
author_email="[email protected]",

0 commit comments

Comments
 (0)