Skip to content

Instantly share code, notes, and snippets.

View tagtog-gists's full-sized avatar

tagtog-gists

View GitHub Profile
@tagtog-gists
tagtog-gists / tagtog-spaCy.py
Last active May 25, 2021 09:09
This is a gist to explain how to easily integrate spaCy and tagtog. Find the article that goes through this gist's context at https://tagtog.medium.com/integrating-tagtog-and-spacy-16fb0addeea1
import spacy
import json
import requests
import os
def get_class_id(label):
"""
Translates the spaCy label id into the tagtog entity type id
- label: spaCy label id
"""
@tagtog-gists
tagtog-gists / tagtog-webhook.py
Last active February 12, 2021 08:53
Example of how to connect your models to tagtog using webhooks. Find the article explaining this gist's context at https://tagtog.medium.com/connect-your-nlp-models-to-tagtog-using-webhooks-13d422ae4dff
from flask import Flask, request, Response
import json
import spacy
import requests
import os
def get_class_id(label):
"""
Translates the spaCy label id into the tagtog entity type id
- label: spaCy label id