You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have run the following sample code for the extractor to perform Q&A on OS X but the results return None:
embeddings = Embeddings({"method": "transformers", "path": "sentence-transformers/bert-base-nli-mean-tokens"})
extractor = Extractor(embeddings, "distilbert-base-cased-distilled-squad")
sections = ["Giants hit 3 HRs to down Dodgers",
"Giants 5 Dodgers 4 final",
"Dodgers drop Game 2 against the Giants, 5-4",
"Blue Jays 2 Red Sox 1 final",
"Red Sox lost to the Blue Jays, 2-1",
"Blue Jays at Red Sox is over. Score: 2-1",
"Phillies win over the Braves, 5-0",
"Phillies 5 Braves 0 final",
"Final: Braves lose to the Phillies in the series opener, 5-0",
"Final score: Flyers 4 Lightning 1",
"Flyers 4 Lightning 1 final",
"Flyers win 4-1"]
sections = [(uid, section) for uid, section in enumerate(sections)]
questions = ["What team won the game?", "What was score?"]
execute = lambda query: extractor(sections, [(question, query, question, False) for question in questions])
for query in ["Red Sox - Blue Jays", "Phillies - Braves", "Dodgers - Giants", "Flyers - Lightning"]:
print("----", query, "----")
for answer in execute(query):
print(answer)
print()
Results:
---- Red Sox - Blue Jays ----
('What team won the game?', None)
('What was score?', None)
---- Phillies - Braves ----
('What team won the game?', None)
('What was score?', None)
---- Dodgers - Giants ----
('What team won the game?', None)
('What was score?', None)
---- Flyers - Lightning ----
('What team won the game?', None)
('What was score?', None)
The text was updated successfully, but these errors were encountered:
Thank you for the report. You most likely have txtai==1.5.0 with sentence-tranformers==0.4.x. There were a couple of compatibility issues that arose when transformers upgraded to 4.x. txtai is due to have a new release within the next couple of days, where this will be addressed.
In the meantime you can do one of the following:
# Downgrade sentence-transformers to 0.3.x
pip install sentence-transformers==0.3.9
or
# Use build from master
pip install git+https://github.com/neuml/txtai
I have run the following sample code for the extractor to perform Q&A on OS X but the results return None:
Results:
The text was updated successfully, but these errors were encountered: