display dictionary statistics for current media#943
Conversation
0499474 to
fb37557
Compare
Deploying asbplayer with
|
| Latest commit: |
a362f7a
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://5517d2dd.asbplayer.pages.dev |
| Branch Preview URL: | https://dictionary-statistics.asbplayer.pages.dev |
fb37557 to
1f604e2
Compare
|
@NovaKing001 Do you have any suggestions for any other statistics? |
|
@ShanaryS Looks great so far! You pretty much added everything I thought of. Here's some extra ideas I thought of. I probably forgot a few obvious ones. Track average words collected per dayWould be helpful to see progress Recommended wordsWould be based on the number of occurrences across different media. Recommended sentencesBased on frequency. would be through recommended words, frequency dictionaries, or occurrences on that video. Future ideasI have some more ideas on the statistics tab but they aren't tied to tokenization so I'll wait until that gets sorted out. I know that you are not currently focusing on UI/UX in this pr but I'm going to throw out some ideas on how the statistics info could be shown I think adding a button on top of the already existing video overlay that shows a simple overview of your current video statistics would be nice. similar to migaku. With a complete overview of the data being shown in the side menu. |
|
Thanks for the suggestions. Right now I'm focusing on the current media rather than between sessions. This will require a db migration so I'd like to get this feature out first and gather more information on what stats people want to track and handle it then. At that point I might just add the changes to the db so we can see how it affects Anki reviews.
I tried to avoid telling users what they should mine and instead just give them information to make the decision themselves. If I were to implement a recommended sentence it would be
I assume this is general counting stats for asbplayer like time spent mining etc? I would add this when adding stats that persist between sessions. I'd still like to hear them now so I can add it to my notes for later.
Yeah that's part of the next steps. |
76b6fe5 to
33c9ad0
Compare
|
Added some more stats, updated PR description. |
33c9ad0 to
cb70446
Compare
0db1fc5 to
3a3c322
Compare
3a3c322 to
7f7f85c
Compare
* First pass on statistics UI - restructure UI flows * Statistics UI state when annotations are disabled * Statistics open in-app without extension * Extract drawer into common component * Show media source info in popup statistics * Spacing/layout adjustments * Side panel responds to in-app subtitles * Fix layout in popup * Iterate on in-app side panel logic * Keyboard shortcut works for side panel (partial on Firefox) * Sidepanel disappears more quickly from tab registry when closed * Support statistics popup, so that keyboard shortcut completely works * Some cleanup * Fix source string overflowing * Annotation settings link in popup is bound * Fix NPE * Iteration on StatisticsSentenceDetailsDialog * Mining from StatisticsSentenceDetailsDialog mostly works - fix mining double firing * Fix warnings/compile errors * Catch up loc changes * Missing import in StatisticsSentenceDetailsDialog.tsx * Memoize sentence entries in StatisticsSentenceDetailsDialog * Statistics UI tweaks - Track-specific snapshots are selected rather than renderd at the same time - Bigger font sizes for statistics sections - Limit number of x-axis labels for comprehension graph * More statistics UI tweaks * Stats overlay initial draft in-app * Popout button in statistics side panel * Stats overlay in extension * FTUE supports light theme * Fix fullscreen overlay not populating * Fit iframe to content * More settings UI tweaks - settings link in "getting started" text doesn't include the period - Progress bar in overlay does not go off the corners - Mobile overlay doesn't go on top of the i+1 sentence dialog * Stats popout button added to popup + layouting fixes * Prevent popup nav buttons from expanding vertically * Stats overlay can be triggered from stats panel
killergerbah
left a comment
There was a problem hiding this comment.
@ShanaryS Feel free to merge when you're ready
|
15383ee to
a702702
Compare


This adds statistics about the current media to aide language learning and sentence mining. I also refactored
SubtitleColoringtoSubtitleAnnotationsand added support for batching/termEntriessince we rely on frequency so much now (disabled until Yomitan PR is accepted).I added
AsyncSemaphoreto all usage of/termEntriessince it gets pretty heavy to generate the statistics (without the batching PR). This means thatlemmatize()can now returnundefinedbut that's only if we reset the Yomitan instance while there is a queue (so practically always still be an array). I updated it to support different priority levels, so the/termEntriesbatch is the highest, then justlemmatize(), thenfrequency(). If batching is available the then there should never be a single/termEntriescall similar to howtokenizeBulk()prevents it.I also fully comprehend what
TabRegistryis doing now so the communication should be robust. I also update the build Anki cache state messages to push to all asbplayer instances, instead of the extension and requested tab (I didn't know how to do it before).The current UI for the statistics is entirely a placeholder, even it being its own settings tab. Feel free to remove it completely and design what you think is best.
DictionaryProviderto handle passing around statistics though only counting the user's total words requires the dictionarySubtitleAnnotationwhich ingest the subtitles into theDictionaryStatisticsclass. It also relays snapshots when requested through the UI.mediaId). It should not be possible for the UI to show statistics for the wrong element (seedictionary-handler.ts, other contexts are trivially safe). The only exception is viewing through the extension popup or settings page since these don't have a clear preference but it's also not really misleading.mediaIdisAsbplayer.idwhen App owned andvideo.srcwhen extension owned. This is good enough for our uses cases but there are small chances of collisions (but generally not a big deal)Statisticstab since it's likely to be the most relevant.I won't go into detail about what's tracked, it should be clear from the Demo. Again, the UI/UX is simply a placeholder, we could move to a toolbar or some other design after this PR is reviewed. I also would like more feedback on anything else worth tracking.
asbplayer-statistics.mp4
One kind of statistics I've considered but decided against is how this session will affect your upcoming Anki reviews. This would require a db migration to handle efficiently (though real time queries won't be too bad since scope is limited). But more importantly the FSRS algorithm should already account for a user's immersion (assuming it's consistent enough) since it will just appear like the user has a good memory (even though its outside Anki "reviews"). So the takeaway would be the same every session and does not offer any new insight that would guide a user's journey outside of maybe extra motivation. These statistics also can be loosely approximated by using the already displaying known words for this content and comparing it with their total known words to see roughly how much reviewing they will be getting.
Did a big refactor that should make forward compatibility easier:
dictionary-statistics.tsnow only ingests sentences and generates snapshots. It does no processing and sends the data rawdictionary-statistics-view.tsprocesses this raw data into whatever the UI desires.Added some more stats:
richTextonly deals with surface forms so using lemmas for statistics will always cause an inconsistency somewhere.