I have an answer from the Haystack framework, which is: <Answer: answer='major mild ncd', score=0.09601292014122009, context='d neurocognitive disorder due hiv infection functi...'> The type of it is <class 'haystack.schema.Answer'>. How to extract the context and the score from it?
I cannot access the elements as for lists or dictionaries
As per Haystack docs (just search for
haystack.schema.Answerto see the example code), you can directly access the values by using -where answer is your
haystack.schema.Answerobject