Skip to content

Instantly share code, notes, and snippets.

@blackerby
blackerby / ner_service.py
Last active April 23, 2023 22:02 — forked from b2m/ner-service.py
Documented FastAPI wrapper arround the NER component of the en_core_web_sm model from spaCy
import spacy
from fastapi import FastAPI
from pydantic import BaseModel, Field
app = FastAPI(
title="NER service based on spaCy",
description="""
Provides the NER component from [spaCy](https://spacy.io/) as web service.
- spaCy: 3.5.2
- Model: [en_core_web_sm](https://spacy.io/models/en#en_core_web_sm)

This companion volume to The Haskell Road to Logic, Math and Programming will enable you to check your solutions to the exercises. It should be used wisely. You should only turn to the solution of an exercise after you have tried to solve the exercise on your own. What the following pages do not provide is a shortcut to understanding.

You don’t expect to improve your swimming or iceskating skills by watching swimming or iceskating contests on TV. If you want to learn how to swim you must be willing to get wet. If you want to learn how to skate, you must venture on the ice skating ring and take the risk of falling. Likewise, you

steps to reproduce:

curl 'http://thequeue.org/cr?id=https%3A%2F%2Faaronsw.jottit.com%2Fhowtoget&title=Aaron%20Swartz:%20howtoget' > how-to-get.html
html2text.py how-to-get.html > how-to-get.md
gist < how-to-get.md

Aaron Swartz: howtoget

# Newbie Programmer
def factorial(x)
if x == 0
return 1
else
return x * factorial(x - 1)
end
end
puts factorial(6)
puts factorial(0)