Skip to content

Tensorflow Wrapping #12834

@mhyeonsoo

Description

@mhyeonsoo

How to reproduce the behaviour

I trained my own custom spacy ner model with the code below.

import random
from spacy.util import minibatch, compounding
from pathlib import Path
from spacy.training import Example

# TRAINING THE MODEL
nlp_ner=spacy.load('en_core_web_sm')
with nlp_ner.disable_pipes(*unaffected_pipes):

  # Training for 30 iterations
  for iteration in range(30):

    # shuufling examples  before every iteration
    random.shuffle(NER_TRAINING_DATA)
    losses = {}
    for batch in spacy.util.minibatch(NER_TRAINING_DATA, size=2):
        for text, annotations in batch:
            # create Example
            doc = nlp_ner.make_doc(text)
            example = Example.from_dict(doc, annotations)
            # Update the model
            nlp_ner.update([example], losses=losses, drop=0.3)

I would liked to convert this model into tensorflow format, but couldn't understand or follow the guides.
Is there any documents explaining conversion of trained spacy ner model directly?

Your Environment

  • Operating System: Ubuntu18.04
  • Python Version Used: 3.10.6
  • spaCy Version Used: 3.6.0
  • Environment Information:

Metadata

Metadata

Assignees

No one assigned

    Labels

    modelsIssues related to the statistical modelsthird-partyThird-party packages and services

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions