Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
nsandiman authored Oct 5, 2024
1 parent 0a8d4ec commit b39a4bf
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -167,11 +167,17 @@ def imagecraft_interface(image_path, reference_text):
"""Process image inputs and generate audio response."""
transcript, audio_buffer = model.generate(image_path, output_type="buffer")

bert_score_result = calculate_bert_score(reference_text, transcript)
bleu_score_result = calculate_bleu_score(reference_text, transcript)
rouge_score_result = calculate_rouge_score(reference_text, transcript)
if not reference_text:
evaluation_result = "No reference text provided for evaluation."
else:
reference_text = reference_text.strip().lower().rstrip('.')
transcript = transcript.strip().lower().rstrip('.')

evaluation_result = f"BERT Score: {bert_score_result:.4f}\nBLEU Score: {bleu_score_result:.4f}\nROUGE Score: {rouge_score_result:.4f}"
bert_score_result = calculate_bert_score(reference_text, transcript)
bleu_score_result = calculate_bleu_score(reference_text, transcript)
rouge_score_result = calculate_rouge_score(reference_text, transcript)

evaluation_result = f"BERT Score: {bert_score_result:.4f}\nBLEU Score: {bleu_score_result:.4f}\nROUGE Score: {rouge_score_result:.4f}"


return audio_buffer, transcript, evaluation_result
Expand Down

0 comments on commit b39a4bf

Please sign in to comment.