Граф коммитов

467 Коммитов

Автор SHA1 Сообщение Дата
Bianca Danforth 836dfaa568
Update version number to 14.0.0 2018-11-20 09:37:16 -08:00
Erik Rose 4cca17a880 Remove unneeded !!. 2018-11-20 11:47:44 -05:00
Erik Rose a57656ab5c Stick types in local names. 2018-11-20 11:45:59 -05:00
Erik Rose c0570d3eb0 Un-inline hasBackgroundInID(). 2018-11-20 11:43:45 -05:00
Erik Rose e9edf39b2f Un-inline the aspect ratio rule. 2018-11-20 11:38:52 -05:00
Erik Rose 45db392a2d Rename contains() functions to indicate what returns bools and what returns scores. 2018-11-20 11:16:06 -05:00
Erik Rose 5d55d10d23 Use single-line doclets where possible. Put a newline after double asterisks for multi-line ones. 2018-11-20 11:12:26 -05:00
Erik Rose 6ce3ea91d5 Rename trapezoid() to linearScale(). 2018-11-20 10:55:38 -05:00
Bianca Danforth 4eab37c830
12.0.0 2018-11-19 15:36:09 -08:00
Bianca Danforth 263cd73ef8
Merge pull request #278 from biancadanforth/274-research-study
Fix #274: Add UR study participation UI
2018-11-19 15:34:53 -08:00
Bianca Danforth 0ba2b18eb5
Update UR survey URL and hero image
Also incorporate feedback from Osmose, including the feature flag 'enableStudyUI' in config.js to turn on/off the UI.
2018-11-19 15:31:35 -08:00
Bianca Danforth 5accc1e916
Fix #274: Add UR study participation UI
Notes:
- I had to put the copy in brackets in StudyInvitation.jsx to be able to use the apostrophe it contains. This avoids the eslint rule error react/no-unescaped-entities.
- The panels are wider than bryanbell's mocks, but the PR for #256 will fix that.
2018-11-17 13:52:11 -08:00
Erik Rose fd6b04302c Make linter happy. 2018-11-16 17:34:29 -05:00
Erik Rose ba89ed4fd5 Fix a mistranscribed coefficient.
This brings our testing accuracy to 92%. I think I trained on one vector (to get the 92% one) but then mistranscribed it into the master vector before I did the testing run. So it should be a legitimate, not-cheating 92%.
2018-11-16 17:03:02 -05:00
Erik Rose ac1d3040f7 Put the glue code back how I found it, and move the coeffs back into the JSON file.
Order the coeffs alphabetically in the ruleset factory so getCoeffsInOrder() works once more.

Upgrade to Fathom 2.8 so FathomFox's good/back-clicking features work when you symlink from a fathom-trainees fork to here. (Yarn looks in pricewise, not in fathom-trainees, for a copy of fathom.)
2018-11-16 16:09:43 -05:00
Erik Rose 82709cfde8 Copy tuned price coeffs to master vector. 2018-11-16 15:01:18 -05:00
Erik Rose 1735fe385a Improve price coeffs: 98.7% on all current training samples (1-25 and all named samples). 2018-11-16 15:01:18 -05:00
Erik Rose 0c888cb636 Improve price coeffs. 93.3% on 12-16, 1-10. 92% on 1-25. 2018-11-16 15:01:18 -05:00
Erik Rose 89da723378 Improve price coeffs: 100% on 12-16. 2018-11-16 15:01:18 -05:00
Erik Rose 9217d835b8 Make a more efficient training vector for price. 2018-11-16 15:01:18 -05:00
Erik Rose 3486879505 Move tuned image coeffs into master vector. 2018-11-16 15:01:18 -05:00
Erik Rose 418a9cf470 Make the image trainee train only the image-affecting coeffs, for speed. 2018-11-16 15:01:18 -05:00
Erik Rose dd16bf0bcf Hard-code a height for aboveTheFold so a user's different window size doesn't make a different answer come out. 2018-11-16 14:56:44 -05:00
Erik Rose 3fc58569fc Add a rule to punish extreme aspect ratios and another to punish background images. This gets us to 100% on the training corpus of 75. 2018-11-16 14:56:44 -05:00
Erik Rose f0eba0dc67 There's no need to say "node". All scoring functions take nodes. 2018-11-16 14:56:44 -05:00
Erik Rose e1f447970b Typos 2018-11-16 14:56:44 -05:00
Erik Rose 307fa3d425 Consider divs with background images as well as img tags.
One of those showed up in 4.html.

Rename imageIsBig() because we're calling it on things other than images now, and it was always general anyway.
2018-11-16 14:56:44 -05:00
Erik Rose 47bbc7a01c Rename hasPriceIn, since it doesn't actually have "price" hard-coded in anymore. 2018-11-16 14:56:44 -05:00
Erik Rose 737ca67619 Add new coeffs to get to 100% on the training set!
Price, title, image: all 100%!
2018-11-16 14:56:44 -05:00
Erik Rose c52af18eaa Remove a now-unused constant and an out-of-date comment. 2018-11-16 14:56:44 -05:00
Erik Rose 74658e9210 Fix the bugs that immediately kept the trainer from training. 2018-11-16 14:56:44 -05:00
Erik Rose 90423dac21 Express hasPriceishPattern as a fuzzy truth.
Also don't require the price to come at the end, in service of the "US $5.00 plus free shipping" use case which I misread "'US $5.00' on eBay" as. Let's see how that goes.
2018-11-16 14:56:44 -05:00
Erik Rose b567dd9feb Rewrite rule that give a bonus to prices near the winning image.
Express it in terms of fuzzy truth. Also greatly simplify. I'd like to test whether this does as well or better than the overlap-testing method.

In doing so, change getHighestScoringImage() to return its fnode, not its element.
2018-11-16 14:56:44 -05:00
Erik Rose 525bd54576 Re-express font-size rule as a confidence.
Add a trapezoid function, mostly to clamp it to 0..1 before we raise it to the coeff's power.

Re-spell largerImage() for consistency. ("Is" is what we've been using for fuzzy-truth values elsewhere, so we adopt it here.)
2018-11-16 14:56:44 -05:00
Erik Rose 8d38da1c3f Change rules that look for "price" in IDs and classes to emit fuzzy confidences. Also the $ rule.
Also break up both "price" rules into separate ones for parent and the actual element so the trainer can come up with optimal coeffs, rather than what I assume is a human guess of .75x difference.

Start those new parent coeffs out at as close to .75x as I could.
2018-11-16 14:56:44 -05:00
Erik Rose 6909520048 Retrain to fix the priceish coeff for isAboutTheFold().
Title and image are unaffected, since they don't really have many rules to balance atm.
2018-11-16 14:56:44 -05:00
Erik Rose 51e6b30f5f Rewrite image y-axis scorer to constrain to 0..1 and for simplicity.
I'm not sure what scaling by the viewport size was getting us before. I could just be dense.

Put the coefficients vector back; I had used a shrunken one for faster training when working on image rules.
2018-11-16 14:56:44 -05:00
Erik Rose 2eb12b8fb6 Refactor largerImage as well. This completes the image coefficients. Images still score 100%. 2018-11-16 14:56:44 -05:00
Erik Rose 46b61d944e Rewrite isAboveTheFold using trapezoid() and fuzzy-logic scores.
I'm hoping this sort of thing will help penalties like the cart one have a more consistent effect, since we'll no longer be blowing up bonuses without bound.
2018-11-16 14:56:44 -05:00
Erik Rose d8e6f43fd7 Bring up to date with 9813ba8b59 in https://github.com/mozilla/price-wise. 2018-11-16 14:56:44 -05:00
Erik Rose ce27b0d5c1 Respell a regex for clarity. 2018-11-16 14:56:44 -05:00
Erik Rose ca8d4c8eb0 Add a trainee for each out() rule so we can choose them from the Trainer menu.
...rather than having to edit the code between training or testing runs.
2018-11-16 14:56:44 -05:00
Erik Rose 2558ea5c62 Get trainer running on image out-rule from webext-commerce.
Basically, copy ruleset_factory.js over from webext-commerce, copy the coeffs out of fathom_default_coefficients.json, and write a line or 2 of glue.
2018-11-16 14:56:31 -05:00
Bianca Danforth c04cb829d9
Merge pull request #270 from biancadanforth/186-more-data
Fix #186: Enable event telemetry and price polling in certain privacy contexts
2018-11-16 08:32:12 -08:00
Bianca Danforth 4ea7eedb97
Fix #186: Enable price polling in certain privacy contexts
Previously, price polling (a.k.a. background price updates) was disabled when Do Not Track, Tracking Protection or certain cookie settings ('reject_third_party' and 'reject_all') were enabled.

Now, price polling occurs in these situations. This leaves the `shouldUpdatePrices` function in `privacy.js` kind of useless, but I left it there instead of removing it entirely in order to add the Private Browsing check that is part of #177.
2018-11-15 10:05:15 -08:00
Bianca Danforth f9d7c5ed82
#186: Enable category 1/2 event telemetry in certain privacy contexts
In order to avoid the eslint `no-cycle` error, I moved all events to be registered to their own `events.js` script, so that both `privacy.js` and `extension.js` could import from `events.js`. (thanks Osmose for the idea)

More about the `no-cycle` error that was avoided: This error came up when I tried to import CATEGORY_3_EVENTS from `./src/telemetry/extension.js` into `./src/privacy.js`, since we were already importing `shouldCollectTelemetry` from the latter into the former.
2018-11-15 10:02:29 -08:00
Bianca Danforth 78660a204c
Merge pull request #267 from biancadanforth/147-update-info
Fix #147: Update product information during re-extraction
2018-11-14 13:01:59 -08:00
Bianca Danforth 6966d85819
Fix JavaScript error introduced by PR #247
Tacking this on, though it's an unrelated error.

Previously, we were attempting to send messages via `tabs.sendMessage` to all content scripts both the ones running in content processes and in the background. However, the tabId for a content script in the background is -1, which is not a valid value for sending messages to content scripts in specific tabs.

Since the code that introduced this error was intended to fix an issue related to badging the browserAction toolbar button to add a new product, and since that badging is only triggered by extraction in content processes, we don't need to worry about sending the message to the background.

Now, we now no longer see the error:
`Type error for parameter tabId (Integer -1 is too small (must be at least 0)) for tabs.sendMessage.`
2018-11-13 18:46:41 -08:00
Bianca Danforth 3f42a3616e
Fix #147: Update product information during re-extraction
Adds a new Redux action UPDATE_PRODUCT which replaces the existing Product object in the store with a new one created from a re-extraction of the product page. The only keys that are not overwritten are the ids: `product.id` and `product.anonId`.
2018-11-13 18:46:33 -08:00
Bianca Danforth ce698b4091
Merge pull request #264 from biancadanforth/262-survey-url
Fix #262: Update survey URL
2018-11-13 13:22:53 -08:00