tweaks to token selection for activities

This commit is contained in:
wcjord 2024-12-03 14:20:12 -05:00
parent f6175b9c09
commit f498727fe0
4 changed files with 29 additions and 15 deletions

View file

@ -115,8 +115,13 @@ class MessageAnalyticsEntry {
// sort the queue by the total xp of the tokens, lowest first
queue.sort(
(a, b) => a.tokens.map((t) => t.xp).reduce((a, b) => a + b).compareTo(
b.tokens.map((t) => t.xp).reduce((a, b) => a + b),
(a, b) => a.tokens
.map((t) => t.vocabConstruct.points)
.reduce((a, b) => a + b)
.compareTo(
b.tokens
.map((t) => t.vocabConstruct.points)
.reduce((a, b) => a + b),
),
);
@ -129,13 +134,13 @@ class MessageAnalyticsEntry {
// limit to 3 activities
final limited = queue.take(3).toList();
debugPrint("activities for ${PangeaToken.reconstructText(_tokens)}");
for (final activity in limited) {
debugPrint("activity: ${activity.activityType}");
for (final token in activity.tokens) {
debugPrint("token: ${token.analyticsDebugPrint}");
}
}
// debugPrint("activities for ${PangeaToken.reconstructText(_tokens)}");
// for (final activity in limited) {
// debugPrint("activity: ${activity.activityType}");
// for (final token in activity.tokens) {
// debugPrint("token: ${token.analyticsDebugPrint}");
// }
// }
return limited;
}

View file

@ -159,9 +159,9 @@ class OneConstructUse {
static String _guessGrammarCategory(String morphLemma) {
for (final String category in morphCategoriesAndLabels.keys) {
if (morphCategoriesAndLabels[category]!.contains(morphLemma)) {
debugPrint(
"found missing construct category for $morphLemma: $category",
);
// debugPrint(
// "found missing construct category for $morphLemma: $category",
// );
return category;
}
}

View file

@ -253,9 +253,9 @@ class PangeaToken {
switch (a) {
case ActivityTypeEnum.wordMeaning:
if (isContentWord) {
return vocabConstruct.points < 10 || daysSinceLastUseByType(a) > 7;
return vocabConstruct.points < 30;
} else if (canBeDefined) {
return !_didActivity(a) && vocabConstruct.points < 5;
return vocabConstruct.points < 5;
} else {
return false;
}

View file

@ -139,9 +139,18 @@ class PracticeActivityCardState extends State<PracticeActivityCard> {
}
debugPrint(
"client requesting ${nextActivitySpecs.activityType.string} for: ${nextActivitySpecs.tokens.map((t) => "word: ${t.text.content} xp: ${t.xp}").join(' ')}",
"client requesting ${nextActivitySpecs.activityType.string} for: ${nextActivitySpecs.tokens.map((t) => "construct: ${t.lemma.text}:${t.pos} points: ${t.vocabConstruct.points}").join(' ')}",
);
// debugger(
// when: kDebugMode &&
// nextActivitySpecs.tokens
// .map((a) => a.vocabConstruct.points)
// .reduce((a, b) => a + b) >
// 30 &&
// nextActivitySpecs.activityType == ActivityTypeEnum.wordMeaning,
// );
final PracticeActivityModelResponse? activityResponse =
await pangeaController.practiceGenerationController
.getPracticeActivity(