mirror of
https://github.com/guillaume-be/rust-bert.git
synced 2024-08-16 16:10:25 +03:00
a34cf9f8e4
* Add checked prediction methods - Add checked prediction methods to ZeroShotClassificationModel. These methods return Option and convert any underlying errors into None, to allow callers to implement appropriate error handling logic. * Update ZeroShot example to use checked method. * Add tests for ZeroShot checked methods * Change checked prediction methods to return Result * refactor: rename *_checked into try_* Rename *_checked methods into try_* methods. This is more idiomatic vis-a-vis the Rust standard library. * refactor: remove try_ prefix from predict methods * refactor: change return from Option to Result Change return type of ZeroShotClassificationModel.prepare_for_model from option into Result. This simplifies the code, and returns the error closer to its origin. This addresses comments from @guillaume-be. * refactor: address clippy lints in tests Co-authored-by: guillaume-be <guillaume.becquin@gmail.com> |
||
---|---|---|
.. | ||
async-sentiment.rs | ||
conversation.rs | ||
generation_gpt2.rs | ||
generation_gpt_neo.rs | ||
generation_reformer.rs | ||
generation_xlnet.rs | ||
keyword_extraction.rs | ||
masked_language_model_bert.rs | ||
named_entities_recognition.rs | ||
natural_language_inference_deberta.rs | ||
part_of_speech_tagging.rs | ||
question_answering_bert.rs | ||
question_answering_longformer.rs | ||
question_answering_squad.rs | ||
question_answering.rs | ||
sentence_embeddings_local.rs | ||
sentence_embeddings.rs | ||
sentiment_analysis_fnet.rs | ||
sentiment_analysis_sst2.rs | ||
sentiment_analysis.rs | ||
sequence_classification_multilabel.rs | ||
sequence_classification.rs | ||
summarization_bart.rs | ||
summarization_pegasus.rs | ||
summarization_prophetnet.rs | ||
summarization_t5.rs | ||
token_classification.rs | ||
translation_builder.rs | ||
translation_m2m100.rs | ||
translation_marian.rs | ||
translation_mbart.rs | ||
translation_t5.rs | ||
zero_shot_classification.rs |