Bird
0
0

Given this code snippet, what will be the output of results?

medium📝 component behavior Q13 of 15
LangChain - Evaluation and Testing
Given this code snippet, what will be the output of results?
inputs = ["Hello", "World"]
model = lambda x: x.lower()
expected = ["hello", "world"]
pipeline = EvaluationPipeline(inputs, model, expected)
results = pipeline.run()
A[True, False]
B[False, False]
C[True, True]
DRuntimeError
Step-by-Step Solution
Solution:
  1. Step 1: Understand the model function

    The model converts each input string to lowercase, so "Hello" -> "hello" and "World" -> "world".
  2. Step 2: Compare model outputs to expected

    Both outputs match the expected list exactly, so evaluation returns True for both.
  3. Final Answer:

    [True, True] -> Option C
  4. Quick Check:

    Lowercase matches expected = True [OK]
Quick Trick: Check if model output matches expected exactly [OK]
Common Mistakes:
MISTAKES
  • Assuming case does not matter
  • Expecting runtime error from lambda
  • Mixing up True and False results

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More LangChain Quizzes