<jupyter_start><jupyter_text><jupyter_code>!pip install deeppavlov
!python -m deeppavlov install squad_bert

#!python -m deeppavlov interact squad_bert -d
from deeppavlov import build_model, configs

model_qa = build_model(configs.squad.squad_bert, download=True)

context_en = "Hi Adibot , my name is Adam and i am calling from Samsung to report a new claim. \
  I was involved in an accident on Regent street in London at 2pm. I was stationary in traffic lights when the third party vehicle hit my vehicle in the rear. \
  My brake lights were turned on when i was stationary.  My vehicle is Aston Martin DB9 and the third party vehicle was Kia Sportage. \
  The rear bumper has got some scratches & scuffs, however the third party vehicle did not suffer any damage. \
  The vehicle is currently at my home address which is Buckingham Palace, London and need immediate repairs.\ I have a full UK driving license and i've been driving in the UK since 2012."

model_qa([context_en, context_en, context_en, context_en, context_en,context_en], 
         ["What vehicle were you driving?",
          "Where is the vehicle currently located?",
          "What is the damage to your vehicle?",
          "What time did you have the accident?",
          "For how long have you held your license?",
          "What vehicle was the third party driving?"])
from deeppavlov import build_model, configs
model_qa_ml = build_model(configs.squad.squad_bert_multilingual_freezed_emb, download=True)  

context_fr = "Salut Adibot, je m'appelle Adam et j'appelle de Samsung pour signaler une nouvelle réclamation. \
  J'ai été impliqué dans un accident sur Regent Street à Londres à 14h. J'étais immobile aux feux de circulation lorsque le véhicule d'un tiers a heurté mon véhicule à l'arrière. \
  Mes feux de freinage étaient allumés lorsque j'étais à l'arrêt. Mon véhicule est Aston Martin DB9 et le véhicule tiers était Kia Sportage. \
  Le pare-chocs arrière a subi quelques rayures et éraflures, mais le véhicule tiers n'a subi aucun dommage. \
  Le véhicule se trouve actuellement à mon domicile, à Buckingham Palace, à Londres, et a besoin de réparations immédiates. \ J'ai un permis de conduire britannique complet et je conduis au Royaume-Uni depuis 2012."

model_qa_ml([context_en, context_fr], 
      ["What vehicle were you driving?",
       "Quel véhicule conduisiez-vous?"])<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.05742821473158552, 'fraction_numerical': 0.005409904286308781, 'mean_word_length': 4.050420168067227, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '255000', 'license': 'Apache-2.0', 'n_tokens_mistral': 751, 'n_tokens_neox': 733, 'n_words': 326, 'path': 'MultilingualBERT.ipynb', 'repo_name': 'AdiHasurkar/examples', 'size': '2403'}