-
Notifications
You must be signed in to change notification settings - Fork 885
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
Implement purchase intent classifier for brave ads 8047 #4607
Implement purchase intent classifier for brave ads 8047 #4607
Conversation
7b2d357
to
0ec35d6
Compare
b66b8ea
to
cb2dc92
Compare
vendor/bat-native-ads/include/bat/ads/purchase_intent_signal_history.h
Outdated
Show resolved
Hide resolved
vendor/bat-native-ads/src/bat/ads/internal/purchase_intent/funnel_site_info.cc
Outdated
Show resolved
Hide resolved
vendor/bat-native-ads/src/bat/ads/internal/purchase_intent/funnel_sites.cc
Outdated
Show resolved
Hide resolved
vendor/bat-native-ads/src/bat/ads/internal/purchase_intent/funnel_sites_unittest.cc
Outdated
Show resolved
Hide resolved
...r/bat-native-ads/src/bat/ads/internal/purchase_intent/purchase_intent_classifier_unittest.cc
Outdated
Show resolved
Hide resolved
...r/bat-native-ads/src/bat/ads/internal/purchase_intent/purchase_intent_classifier_unittest.cc
Outdated
Show resolved
Hide resolved
vendor/bat-native-ads/src/bat/ads/internal/purchase_intent/funnel_sites.cc
Outdated
Show resolved
Hide resolved
vendor/bat-native-ads/src/bat/ads/internal/purchase_intent/funnel_sites.cc
Outdated
Show resolved
Hide resolved
vendor/bat-native-ads/src/bat/ads/internal/purchase_intent/funnel_sites.cc
Outdated
Show resolved
Hide resolved
vendor/bat-native-ads/src/bat/ads/internal/purchase_intent/funnel_sites.cc
Show resolved
Hide resolved
463b1e4
to
c78caf1
Compare
e7abab4
to
bb2ae9b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM++
bb2ae9b
to
5c1ae1a
Compare
}; | ||
|
||
static const std::vector<FunnelSiteInfo> _automotive_funnel_sites = { | ||
FunnelSiteInfo( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't need to call constructor explicitly. Use std::initializer_list instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gdregalo like this? FunnelSiteInfo {_funnel_site_segments, "http://autotrader.com", 1}
What's the benefit here? These static lists will be pulled out and refactored with the next piece of work to support "out of band" updates
bool Keywords::IsSubset( | ||
std::vector<std::string> keyword_set_a, | ||
std::vector<std::string> keyword_set_b) { | ||
std::sort(keyword_set_a.begin(), keyword_set_a.end()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible to use std::set
instead, if it doesn't break interface agreement? We don't need to sort it then.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gdregalo I added the existing ticket as a comment. Set impl is planned to come with the next PR as well. Are you happy with that or should we change for this PR?
// TODO(https://github.com/brave/brave-browser/issues/8495): Implement Brave Ads Purchase Intent keyword matching with std::sets
max_segments = history.size(); | ||
} | ||
|
||
std::vector<std::pair<std::string, uint16_t>> scores; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we use std::map or std::multimap instead of vector? It will give us a sorted sequence by default.
5c1ae1a
to
eea45ed
Compare
eea45ed
to
a34c332
Compare
0993e4a
to
13ae2f8
Compare
… Ads purchase intent
13ae2f8
to
72a2dc0
Compare
Fixes brave/brave-browser#8047
Submitter Checklist:
npm run lint
)git rebase master
(if needed).git rebase -i
to squash commits (if needed).Test Plan:
keywords.h
, try to trigger a match by visiting a listed site or searching for keywords on various search engines. If successful the log should printPurchase intent signal extracted for ...
/Applications/Brave\ Browser\ Nightly.app/Contents/MacOS/Brave\ Browser\ Nightly --enable-logging=stderr --log-level=2 --brave-ads-staging --rewards=staging=true
Segment and funnel sites lists + search providers: https://docs.google.com/spreadsheets/d/1RYts5OWZOhT5HUletTKMdRJwTe1p1gjqH43JmplZ5QM/edit#gid=0
Reviewer Checklist:
After-merge Checklist:
changes has landed on.