Skip to content

Empty predictions for long(er) contexts #3

@JackMurphy97

Description

@JackMurphy97

Hey! Big fan of this piece of work! I'm trying this out on a tool response use case but getting nothing back. It works on the short Paris example in the docs but when I make the context a bit longer it seems to break, even though it's nowhere near the 4k max token limit. Any ideas what's going wrong here?

Even in the token level predictions, I'm getting back an empty list (instead of a list of token-level predictions).

The below is dummy data

context = """
TOOL RESPONSE:

{
"data": [
{
"id": "eating-out",
"attributes": {
"name": "Eating Out",
"discretionary": True,
"amount-this-period": "$22.31",
"daily-spend-this-period": "$2.79",
"average-transaction-amount-this-period": "$11.16",
"transactions-this-period": 2,
"ranking-this-period": 2,
"amount-previous-period": "$94.00",
"transactions-previous-period": 2,
"daily-spend-percentage-change": "-76%"
}
},
]
"meta": {
"amount-this-period": "$263",
"daily-spend-this-period": "$32.92",
"average-transaction-amount-this-period": "$21.95",
"transactions-this-period": 12,
"time-period-start-at": "2025-02-26",
"time-period-end-at": "2025-03-05",
}
}
"""
question = "How much did I spend on eating out"
answer = "You spent $263 on eating out in the last 2 weeks."

predictions = detector.predict(context=context, question=question, answer=answer, output_format="spans")
print("Span Predictions:", predictions)

predictions = detector.predict(context=context, question=question, answer=answer, output_format="tokens")
print("Token Predictions:", predictions)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions