summaryrefslogtreecommitdiff
path: root/src/tools/analysis/predict-all-post-category.ts
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2018-03-29 20:32:18 +0900
committersyuilo <syuilotan@yahoo.co.jp>2018-03-29 20:32:18 +0900
commitcf33e483f7e6f40e8cbbbc0118a7df70bdaf651f (patch)
tree318279530d3392ee40d91968477fc0e78d5cf0f7 /src/tools/analysis/predict-all-post-category.ts
parentUpdate .travis.yml (diff)
downloadmisskey-cf33e483f7e6f40e8cbbbc0118a7df70bdaf651f.tar.gz
misskey-cf33e483f7e6f40e8cbbbc0118a7df70bdaf651f.tar.bz2
misskey-cf33e483f7e6f40e8cbbbc0118a7df70bdaf651f.zip
整理した
Diffstat (limited to 'src/tools/analysis/predict-all-post-category.ts')
-rw-r--r--src/tools/analysis/predict-all-post-category.ts35
1 files changed, 0 insertions, 35 deletions
diff --git a/src/tools/analysis/predict-all-post-category.ts b/src/tools/analysis/predict-all-post-category.ts
deleted file mode 100644
index 8564fd1b10..0000000000
--- a/src/tools/analysis/predict-all-post-category.ts
+++ /dev/null
@@ -1,35 +0,0 @@
-import Post from '../../server/api/models/post';
-import Core from './core';
-
-const c = new Core();
-
-c.init().then(() => {
- // 全ての(人間によって証明されていない)投稿を取得
- Post.find({
- text: {
- $exists: true
- },
- is_category_verified: {
- $ne: true
- }
- }, {
- sort: {
- _id: -1
- },
- fields: {
- _id: true,
- text: true
- }
- }).then(posts => {
- posts.forEach(post => {
- console.log(`predicting... ${post._id}`);
- const category = c.predict(post.text);
-
- Post.update({ _id: post._id }, {
- $set: {
- category: category
- }
- });
- });
- });
-});