···
1
1
import { subHours } from "date-fns";
2
2
import { and, eq, gte, inArray, isNull } from "drizzle-orm";
3
3
-
import { mutedWordsClassifier } from "../classifiers/tech/muted-words";
4
4
-
import { techLinkClassifier } from "../classifiers/tech/tech-links";
5
5
-
import { techWordsRegExp } from "../classifiers/tech/tech-words";
6
3
import { createBayesClassiferFn } from "../classifiers/tfjs";
7
4
import type { ClassifierFn } from "../classifiers/types";
8
5
import { createAtContext } from "../context";
···
12
9
import { postTable } from "../domain/post/post.table";
13
10
14
11
export const LISTEN_NOTIFY_POSTQUEUE = "atproto.postqueue";
15
15
-
const POSTS_PER_CLASSIFIER_RUN = 500;
16
12
17
13
// TODO: Need to move this and all of its deps to a new package. TFJS SUUUUCKS
18
14
export async function classifier(postUri?: Array<string>) {
···
20
16
const ctx = await createAtContext();
21
17
22
18
const classifiers: Array<ClassifierFn> = [
23
23
-
mutedWordsClassifier,
24
24
-
techWordsRegExp,
25
25
-
techLinkClassifier,
19
19
+
// mutedWordsClassifier,
20
20
+
// techWordsRegExp,
21
21
+
// techLinkClassifier,
26
22
];
27
23
28
24
// If not enough training data, the bayes classifier is skipped