Training the named entity recognizer in SpaCy - named-entity-recognition

I am trying to add a new entity to the SpaCy model for which I am followed this resource:
Training the Entity Recognizer
As per the documentation SpaCy requires a few 100 examples in order to add a new entity, which I have added accordingly.
Yet my model fails to recognize the new entity when presented by a random text.
What is it that I am doing wrong.

Related

Annotate Entity inside another Entity

We have to extract an entity which is inside another entity, any idea on how can we annotate the training data to train a NER model for this task. We are using Flair model for custom entity training and prediction.
Ex: Text: "" Address: 123, ABC Company, 4th floor, xyz street, state, country.""
We have a sample like this, where whole text itself is an entity of type "Address" and in the same text we have another entity called "Company Name".
For train a flair model, we are converting the data into BIEO format, not sure how to annotate the data and train the model.
We came up with a solution to handle this scenario by training two models, one for address and other for company name.
Comment your approach on how we can handled this kind of a scenario in much better way.

Add custom entity in addition to NER basic model

I am using spacy to train my own NER model. In addition to entities trained by spacy basic 'en_core_web_sm' model (ORG, PERSON, DATE, etc), I want to add my own entities. I trained my model with 'en_core_web_sm' as my base model, but then the model can only detect my own custom entities only, not the basic entities. Is there any way to do this? Thanks.
You can definitely do this with spaCy, cf the docs and also check Matt's blogpost around the problem of "catastrophic forgetting" (when your model "forgets" about the old types it knew before, which you obviously want to avoid).

How to get detected image coordinates/image object from core ml model response?

I am working on object detection using Vision framework and core ml model. I got success to detect object with this.
But in my case i want to fetch detected image in response not only object name and confidence.
Ex. Try to identify banana through camera and model class returns banana and confidence level. But i also want banana image from it. But model class has no output property to return it. i am using Inceptionv3 model for this.
Is there any other model class for this purpose ?

smart/automated/suggestive data mapping

I want to implement a tool which can transform (or at least suggest) one data model into another data model . For example one data model has two fields, 'first_name' and 'last_name' and 2nd data model has one field 'name' . Then tool should be able to suggest concatenation of 'first_name' and 'last_name'. A different use can be a mapping suggestion between two fields whose name are different but they mean the same thing .For ex map 'supplier_id' from source data model to 'customer_id' in destination data model (A typical case of supplier relation management scenario).
I have seen approaches based on Machine Learning , heuristics and some research papers for semantic translation/mapping as well but couldn't find anything concrete .
Any pointers for start will be highly appreciated .

Core Data with Swift - Parent/child relationship

I'm trying to create a workout logging application using Swift. I have two entities, a "Workout" and "Lift". The "Lift" entity is supposed to be the child of the "Workout".
Whenever I create a new lift, I want it to be associated with that workout. Right now, my application will show every lift created regardless of the workout.
Here's an idea of my current Core Data model.
Entity: Workout
Attributes:
lifts, name, numOfLifts
Entity: Lift
Attributes:
liftName, sets, numOfSets
Looking through examples on SO, it seems like I need something where the lifts attribute of the workout class points to the lift entity. The problem was I couldn't find any examples using Swift.
Any help is appreciated, I can post code if needed or screenshots.
Have you setup a relationship between the Workout and Lift entities in XCode. If each Workout will have only one Lift then use One-to-One, otherwise if each Workout has many Lifts then use One-to-Many.
Once the link is established you just tell the new Lift Entity (at the point when you create it) which Workout it should be connected to.
See this thread for more information:
Saving CoreData to-many relationships in Swift

Resources