From 5dcfdfcd2815f6a2b51c970eab877332beaedd9b Mon Sep 17 00:00:00 2001 From: oiwn Date: Sat, 17 Aug 2024 00:57:32 +0700 Subject: [PATCH] add serde for Keyword --- src/pipelines/keywords_extraction/pipeline.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/pipelines/keywords_extraction/pipeline.rs b/src/pipelines/keywords_extraction/pipeline.rs index a4e18ef3..10702aaa 100644 --- a/src/pipelines/keywords_extraction/pipeline.rs +++ b/src/pipelines/keywords_extraction/pipeline.rs @@ -31,12 +31,13 @@ use crate::pipelines::sentence_embeddings::{ use crate::{Config, RustBertError}; use regex::Regex; use rust_tokenizers::Offset; +use serde::{Deserialize, Serialize}; use std::borrow::Cow; use std::cmp::min; use std::collections::{HashMap, HashSet}; /// # Keyword generated by a `KeywordExtractionModel` -#[derive(Debug, Clone)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct Keyword { /// String representation of the keyword pub text: String,