mirror of
https://github.com/TheAnachronism/docspell.git
synced 2025-06-21 18:08:25 +00:00
Add classifier settings
This commit is contained in:
@ -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]
|
||||
|
||||
}
|
Reference in New Issue
Block a user