shuffle titles for broader topic
This commit is contained in:
@@ -9,7 +9,13 @@ import 'package:flutter_mozilla_components/src/pigeons/gecko.g.dart';
|
|||||||
final _apiInstance = GeckoMlApi();
|
final _apiInstance = GeckoMlApi();
|
||||||
|
|
||||||
class GeckoMlService {
|
class GeckoMlService {
|
||||||
Future<String> getContainerTopic(Set<String> titles, {int maxCount = 10}) {
|
Future<String> getContainerTopic(Set<String> titles, {int maxCount = 8}) {
|
||||||
return _apiInstance.getContainerTopic(titles.take(maxCount).toList());
|
var selectedTitles = titles.toList();
|
||||||
|
if (selectedTitles.length > maxCount) {
|
||||||
|
//TODO: Randomize for now, maybe use clusters later
|
||||||
|
selectedTitles = (selectedTitles..shuffle()).take(maxCount).toList();
|
||||||
|
}
|
||||||
|
|
||||||
|
return _apiInstance.getContainerTopic(selectedTitles);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user