pub enum Format {
Csv,
Jsonl,
Spacy,
Brat,
Conll,
}
Expand description
A struct used to deserialize output format from the configuration file.
Variants§
Implementations§
source§impl Format
impl Format
sourcepub fn save(
&self,
annotations: Vec<Document>,
path: &str
) -> Result<String, Error>
pub fn save( &self, annotations: Vec<Document>, path: &str ) -> Result<String, Error>
Save annotations to a file in the specified format
Examples
use quickner::models::Format;
use quickner::models::Document;
let annotations = vec![Annotation::from_string("Hello World".to_string())];
let format = Format::Spacy;
let path = "./test";
let result = format.save(annotations, path);
Errors
Returns an error if the file cannot be written
Panics
Panics if the format is not supported
Trait Implementations§
source§impl<'de> Deserialize<'de> for Format
impl<'de> Deserialize<'de> for Format
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more