aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/tests/plugins/tf
diff options
context:
space:
mode:
author简律纯 <i@jyunko.cn>2023-11-06 23:29:40 +0800
committer简律纯 <i@jyunko.cn>2023-11-06 23:29:40 +0800
commitf3bea281fbe19f5c8b4fae94b8832eee3ccfcf70 (patch)
tree90132b80b643cdf5e3295e93dda542c27bb5283a /tests/plugins/tf
parent70c118d37cd784861bec712000d7014302591256 (diff)
downloadHydroRoll-f3bea281fbe19f5c8b4fae94b8832eee3ccfcf70.tar.gz
HydroRoll-f3bea281fbe19f5c8b4fae94b8832eee3ccfcf70.zip
refactor(file tree): `tests` -> `example`
Diffstat (limited to 'tests/plugins/tf')
-rw-r--r--tests/plugins/tf/__init__.py52
-rw-r--r--tests/plugins/tf/config.py0
2 files changed, 0 insertions, 52 deletions
diff --git a/tests/plugins/tf/__init__.py b/tests/plugins/tf/__init__.py
deleted file mode 100644
index ce78d97..0000000
--- a/tests/plugins/tf/__init__.py
+++ /dev/null
@@ -1,52 +0,0 @@
-
-from iamai import Plugin
-from iamai.log import logger as _logger
-from HydroRoll.models.cos_sim import cosSim
-import jieba
-
-logger = _logger
-
-
-texts = [
- "你好 HydroRoll",
- "你好 水系",
- "hi 水系",
- "hi HydroRoll",
- "hello 水系",
- "hello HydroRoll",
- "hola 水系",
- "hola HydroRoll",
-]
-
-cos_Sim = cosSim(texts)
-logger.info(f"{cos_Sim.calcuSim('你好')}")
-
-cos_Sim.save('cos.h5')
-
-model = cosSim.load('cos.h5')
-
-logger.info(f"{model}")
-
-# class Sim(Plugin):
-# async def handle(self) -> None:
-# try:
-
-# txt_list = eval(self.event.message.get_plain_text()[5:])
-# if len(txt_list) == 1:
-# await self.event.reply(f"{cos_Sim.CalcuSim(txt_list)}")
-# elif len(txt_list) == 2:
-# corpuss = [" ".join(jieba.cut(text))
-# for text in eval(self.event.message.get_plain_text()[5:])]
-# await self.event.reply(str(corpuss))
-# vocabulary = cos_Sim.getVocabulary(corpuss)
-# v = cos_Sim.getVectors(corpuss, vocabulary=vocabulary)
-# await self.event.reply(f"weight\n=========\n{v}")
-# await self.event.reply(f"相似度\n=========\n{cos_Sim.cos_sim(v[0], v[1])}")
-# except Exception as e:
-# await self.event.reply(f"{e!r}")
-
-# async def rule(self) -> bool:
-# return self.event.type == "message" and self.event.message.startswith(".cos")
-
-
-
diff --git a/tests/plugins/tf/config.py b/tests/plugins/tf/config.py
deleted file mode 100644
index e69de29..0000000
--- a/tests/plugins/tf/config.py
+++ /dev/null