Add classifier settings

This commit is contained in:
Eike Kettner
2020-08-28 22:17:49 +02:00
parent 53fdb100ab
commit 8c4f2e702b
17 changed files with 649 additions and 56 deletions

View File

@ -0,0 +1,35 @@
package docspell.common
import docspell.common.syntax.all._
import io.circe._
import io.circe.generic.semiauto._
/** Arguments to the classify-item task.
*
* This task is run periodically and learns from existing documents
* to create a model for predicting tags of new documents. The user
* must give a tag category as a subset of possible tags..
*/
case class LearnClassifierArgs(
collective: Ident
) {
def makeSubject: String =
"Learn tags"
}
object LearnClassifierArgs {
val taskName = Ident.unsafe("learn-classifier")
implicit val jsonEncoder: Encoder[LearnClassifierArgs] =
deriveEncoder[LearnClassifierArgs]
implicit val jsonDecoder: Decoder[LearnClassifierArgs] =
deriveDecoder[LearnClassifierArgs]
def parse(str: String): Either[Throwable, LearnClassifierArgs] =
str.parseJsonAs[LearnClassifierArgs]
}