Comments (5)
I agree. Wrote #130 to capture it separate from this issue.
from phileas.
The first case turns out to be easy to solve with ignoredPatterns
, since Unix timestamps will always be 13 digits long and have a specific preamble.
CreditCard x = new CreditCard();
x.setIgnoredPatterns(List.of(new IgnoredPattern("1[5-8][0-9]{11}"))); // ignore unix timestamps
With ignoredPatterns
set, Phileas still identifies these spans but does not apply them:
String value = "{ \"valid_until_millis\":\"1647725122227\" }";
FilterResponse fr = r.filter(value);
expect(fr.explanation().appliedSpans().size()).toEqual(0);
expect(fr.explanation().identifiedSpans().size()).toEqual(1);
expect(fr.explanation().identifiedSpans().get(0).getConfidence()).toEqual(0.9);
expect(fr.explanation().identifiedSpans().get(0).getFilterType().toString()).toEqual("credit-card");
expect(fr.explanation().identifiedSpans().get(0).getText()).toEqual("1647725122227");
expect(fr.filteredText()).toEqual(value);
👆 no changes to Phileas required to solve this first part
from phileas.
That is really awesome. Do you think it be beneficial to include that ignored pattern as an option in the filter profile just to keep the user from having to set it manually? There could be a boolean on CreditCard
called ignoreUnixTimestamps
and when true
it checks the credit card against that pattern.
from phileas.
Well, I'm applying this ignoredPattern
in multiple places already -- so if Phileas provided an option like that, I'd definitely use it. Beyond the reuse aspect, seems like a nice improvement to what Phileas understands about credit cards, for little new code 🤔
from phileas.
The changes proposed in 129-credit-card-dashes
will wrap up the rest of this one
Sorry this turned out to be a multi-part issue, I'll try to keep things more atomic ⚛️
from phileas.
Related Issues (20)
- Expose the contextual terms and initial confidence for an identifier filter in the policy
- Use a bloom filter in the IgnoredTermsFilter HOT 1
- Enable caching for additional filters HOT 1
- Create a constant for "SAME" for the mask filter strategy
- `windowSize` should be configurable for each filter instead of only in `PhileasConfiguration`
- Enable caching for custom dictionary and identifier filters
- Using filter condition causes writes to stderr
- Email address filtering needs optimization or relaxed mode HOT 1
- Reduce required third-party dependencies for Phileas core by removing `phileas-metrics-service` HOT 2
- getFiltersForPolicy is a performance hotspot HOT 2
- Improve docs for building on Mac
- Missing models for Person V2 tests HOT 2
- appliedSpans includes spans that didn't meet filter condition HOT 1
- Add a property to the Credit Card filter to ignore spans which are in Unix timestamps
- Validate top-level domains for email addresses HOT 1
- Look at separating `phileas-core`
- Update dependency versions.
- Update antlr dependency version
- Have performance tests run during the build HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from phileas.