aboutsummaryrefslogtreecommitdiffstats
path: root/lib/public/TextProcessing/TopicsTaskType.php
diff options
context:
space:
mode:
authorMarcel Klehr <mklehr@gmx.net>2023-07-14 15:59:50 +0200
committerMarcel Klehr <mklehr@gmx.net>2023-07-14 16:00:31 +0200
commitffe27ce14ca74b509c8721c9fba7c759498fa471 (patch)
treebfed281ed9d76d6087ca946331ee27d8345c3acd /lib/public/TextProcessing/TopicsTaskType.php
parentbd45c436ebc710da2309dca232173d8133e9e06a (diff)
downloadnextcloud-server-ffe27ce14ca74b509c8721c9fba7c759498fa471.tar.gz
nextcloud-server-ffe27ce14ca74b509c8721c9fba7c759498fa471.zip
Massive refactoring: Turn LanguageModel OCP API into TextProcessing API
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Diffstat (limited to 'lib/public/TextProcessing/TopicsTaskType.php')
-rw-r--r--lib/public/TextProcessing/TopicsTaskType.php60
1 files changed, 60 insertions, 0 deletions
diff --git a/lib/public/TextProcessing/TopicsTaskType.php b/lib/public/TextProcessing/TopicsTaskType.php
new file mode 100644
index 00000000000..8b41b3ee61a
--- /dev/null
+++ b/lib/public/TextProcessing/TopicsTaskType.php
@@ -0,0 +1,60 @@
+<?php
+
+declare(strict_types=1);
+
+/**
+ * @copyright Copyright (c) 2023 Marcel Klehr <mklehr@gmx.net>
+ *
+ * @author Marcel Klehr <mklehr@gmx.net>
+ *
+ * @license GNU AGPL version 3 or any later version
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+namespace OCP\TextProcessing;
+
+use OCP\IL10N;
+
+/**
+ * This is the text processing task type for topics extraction
+ * @since 27.1.0
+ */
+class TopicsTaskType implements ITaskType {
+ /**
+ * Constructor for TopicsTaskType
+ *
+ * @param IL10N $l
+ * @since 27.1.0
+ */
+ public function __construct(
+ private IL10N $l,
+ ) {
+ }
+
+
+ /**
+ * @inheritDoc
+ */
+ public function getName(): string {
+ return $this->l->t('Extract topics');
+ }
+
+ /**
+ * @inheritDoc
+ */
+ public function getDescription(): string {
+ return $this->l->t('Extracts topics from a text and outputs them separated by commas.');
+ }
+}