Skip to content

0.4.6

Compare
Choose a tag to compare
@tholor tholor released this 10 Jul 13:28
· 538 commits to master since this release

Main changes

  • Upgrading to Pytorch 1.5.1 and transformers 3.0.2
  • Important bug fix for language model training from scratch
  • Bug fixes and big refactorings for Question Answering, incl. a specialized QAInferencer with dedicated In- and Output objects to simplify usage and code completion:
from farm.infer import QAInferencer
from farm.data_handler.inputs import QAInput, Question

nlp = QAInferencer.load(
    "deepset/roberta-base-squad2",
    task_type="question_answering",
    batch_size=16,
    num_processes=0)

input = QAInput(
    doc_text="My name is Lucas and I live on Mars.",
    questions=Question(text="Who lives on Mars?",
                       uid="your-id"))

res = nlp.inference_from_objects([input], return_json=False)[0]

# High level attributes for your query
print(res.question)
print(res.context)
print(res.no_answer_gap)
# ...
# Attributes for individual predictions (= answers)
pred = res.prediction[0]
print(pred.answer)
print(pred.answer_type)
print(pred.answer_support)
print(pred.offset_answer_start)
print(pred.offset_answer_end)
# ...

Details

Question Answering

  • Add meta attribute to QACandidate for Haystack #455
  • Fix start and end offset checks in QA #450
  • Fix offset_end character for QA #449
  • Dedicated Input Objects for QA #445
  • Question Answering improvements: cleaner code, more typed objects, better compatibility between SQuAD and Natural Questions #411, #438, #419

Other

  • Upgrade pytorch and python versions #447
  • Upgrade transformers version #448
  • Fix randomisation of train file for training from scratch #427
  • Fix loading of saved models with class weights #431
  • Remove raising exception errors in processor #451
  • Fix bug in benchmark tests with if statement #430
  • Remove hardcoded seeds from trainer #424
  • Conditional num_training_steps setting #437
  • Add badge with link to doc page #432
  • Fix for CI problem - closing multiprocessing.pool again #403

👨‍🌾 👩‍🌾 Thanks to all contributors for making FARMer's life better!
@PhilipMay, @tstadel, @brandenchan, @tanaysoni, @Timoeller, @tholor, @bogdankostic