Skip to content
Snippets Groups Projects

Resolve "NKJP parameter tuning"

Closes #6 (closed)

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
17 19
18 20 print("Loading the NER model ...")
19 21 print(args)
22
23 missing = check_for_data('./config.json')
24 missing = list(filter(lambda x: x['name'] not in ['RoBERTa_base', 'RoBERTa_large', 'KPWR_n82_base'], missing))
25 if len(missing) > 0:
26 show_download_menu(missing)
  • Brakujące zasoby powinny być pobierane na żądanie, tzn. wtedy, kiedy następuje do nich odwołanie. Przy tym rozwiązaniu zostaną pobrane wszystkie brakujące zasoby, nawet te, które w danym momencie nie będą potrzebne.

  • Please register or sign in to reply
  • core/pdn2.py 0 → 100644
    1 import os
    2 from core.poldeepner import PolDeepNer2
    3
    4
    5 class ModelFactory:
    6
    7 def get_resource(self, name, resources_path):
    8 path = os.path.join(resources_path, name)
    9 # Check, if the resource exists. If not download it.
    • Tutaj powinno nastąpić sprawdzenie, czy dany zasób istnieje. Pomysł jest taki:

      Tworzymy obiekt fabryki:

      factory = ModelFactoryKpwrN82Large()

      Ładujemy model. Katalog "./models" będzie katalogiem, w którym sprawdzamy obecność zasobów:

      ner = factory.load(resources_path="./models")

      W momencie wykonywania load wykonywane są metody get_resource(roberta_large_fairseq) i get_resource(kpwr_n82_large). Metoda sprawdza, czy zasoby isnieją w zadanym katalogu. Jeżeli nie i są to nazwy zdefiniowane w pliku z zasobami, to następuje pobranie.

    • Michał Marcińczuk changed this line in version 3 of the diff

      changed this line in version 3 of the diff

    • Please register or sign in to reply
  • config.json 0 → 100644
    1 {
    2 "requiredModules": {
    3 "spacy": {
    4 "name": "spacy",
    5 "dir": "data/spacy",
    6 "url": "http://zil.ipipan.waw.pl/SpacyPL?action=AttachFile&do=get&target=pl_spacy_model-0.0.1.tar.gz",
    7 "compression":"tar.gz"
    8 },
    9 "RoBERTa_base":{
    10 "name": "RoBERTa_base",
  • config.json 0 → 100644
    1 {
    2 "requiredModules": {
    3 "spacy": {
    4 "name": "spacy",
    5 "dir": "data/spacy",
    6 "url": "http://zil.ipipan.waw.pl/SpacyPL?action=AttachFile&do=get&target=pl_spacy_model-0.0.1.tar.gz",
    7 "compression":"tar.gz"
    8 },
    9 "RoBERTa_base":{
    10 "name": "RoBERTa_base",
    11 "dir": "models/roberta_base_fairseq",
  • Please register or sign in to reply
    Loading