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

Fix CSV analysis #25

Merged
merged 13 commits into from
Oct 8, 2024
Merged

Fix CSV analysis #25

merged 13 commits into from
Oct 8, 2024

Conversation

artfuldev
Copy link
Contributor

@artfuldev artfuldev commented Oct 8, 2024

Fix #24

In this PR, we primarily fix #24. We do this by:

  • introducing a new CSV analyzer engine that just treats it as text,
  • providing the text in a better context for the analyzer to work better, and
  • capturing the indices and transforming them to work for the text (we get indices for the cell, we fix it for the file)

In addition, we

  • make stdio the only way to interact with the CLI
  • fix the documentation
  • add documentation for the --csv mode
  • fix the app tests for /analyze endpoint
  • skip the app tests for /anonymize endpoint (more changes are needed to the API)

Sample usage:

$ cat sample_data.csv
id,name,city,comments
1,Sowmya,New York,called him yesterday to confirm he requested to call back in 2 days
2,Jill,Los Angeles,accepted the offer license number AC432223
3,Jack,Chicago,need to call him at phone number 212-555-5555
$ cat sample_data.csv | pii analyze --csv | pii anonymize | jq -r '.text'
id,name,city,comments
1,<PERSON>,<LOCATION>,called him yesterday to confirm he requested to call back in 2 days
2,<PERSON>,<LOCATION>,accepted the offer license number <US_DRIVER_LICENSE>
3,<PERSON>,<LOCATION>,need to call him at phone number <PHONE_NUMBER>

@artfuldev artfuldev requested a review from akshaykarle October 8, 2024 10:50
@artfuldev artfuldev merged commit 8a487dc into main Oct 8, 2024
1 check passed
@artfuldev artfuldev deleted the fix-csv-analysis branch October 8, 2024 12:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CSV analysis is broken
1 participant