Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Metadata auto-detection should tokenize words before determining PII #1725

Closed
npatki opened this issue Dec 19, 2023 · 0 comments · Fixed by #1745
Closed

Metadata auto-detection should tokenize words before determining PII #1725

npatki opened this issue Dec 19, 2023 · 0 comments · Fixed by #1745
Assignees
Labels
feature:metadata Related to describing the dataset feature request Request for a new feature
Milestone

Comments

@npatki
Copy link
Contributor

npatki commented Dec 19, 2023

Problem Description

As of SDV 1.8.0, the metadata can auto-detect semantic (PII) sdtypes such as vin (vehicle identifier number) or administrative_unit (a state/province). It does this by checking to see if the column name contains important substrings such as 'vin' or 'state'.

Unfortunately this can lead to unexpected results:

  • A column named resolving_loans would be identified as sdtype 'vin' be cause the word resolving contains the substring 'vin'
  • A column named RealEstateLoans would be identified as sdtype 'administrative_unit' because the word Estate contains the substring 'state' (which is a type of administrative region).

Expected behavior

Instead of checking to see if any substring matches the keywords, the metadata auto-detection script should tokenize the column names first. Then, it should check for exact matches within the tokenized words.

We can tokenize names that contain underscores or camel-case letters. Consider the above examples:

  • Column resolving_loans would be tokenized into ['resolving', 'loans']. None of these words exactly match the keyword vin so the sdtype cannot be vin.
  • Column RealEstateLoans would be tokenized into ['real', 'estate', 'loans']. None of these words exactly match the keyword state so the sdtype cannot be state.

On the other hand:

  • Column vin_number would be tokenized into ['vin', 'number'], which exactly matches 'vin'
  • Column StateDepartment would be tokenized into ['state', 'department'], which exactly matches 'state'

Additional context

We should be careful with camel-case.

  • All-caps words should not be tokenized (EXAMPLE)
  • All-caps words with undersscores should be tokenized (EXAMPLE_COLUMN --> ['example', 'column'])
@npatki npatki added feature request Request for a new feature feature:metadata Related to describing the dataset labels Dec 19, 2023
@amontanez24 amontanez24 added this to the 1.10.0 milestone Feb 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature:metadata Related to describing the dataset feature request Request for a new feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants