Overview
The Coherence metric assesses the logical flow and consistency of paragraphs in text generated by a model. It evaluates the coherence by analyzing the transitions between consecutive statements, determining if each subsequent statement logically follows from the one before it. A high coherence score indicates a well-structured text with clear, logical progressions.CoherenceMetric utilizes the evaluateCoherence function to calculate this metric.
Methods
evaluateCoherence Function
This function evaluates the coherence of the generated text by assessing the logical flow between consecutive statements.
output: The text generated by the model.
CoherenceMetric Class
CoherenceMetric leverages the evaluateCoherence function to determine the logical flow and consistency of the paragraph in the generated text.
output: The text generated by the model.
evaluateSteps method calls evaluateCoherence and returns a result that includes the coherence score and a reason for the evaluation. The method focuses on the clarity of transitions and the logical structuring of content.