From eabebc61a88ca953ebae612f70a0f0a9ad76b088 Mon Sep 17 00:00:00 2001 From: oiwn <398035+oiwn@users.noreply.github.com> Date: Sun, 18 Aug 2024 16:10:58 +0700 Subject: [PATCH] add serde for Keyword (#465) Co-authored-by: guillaume-be --- 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 a4e18ef..10702aa 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,