Skip to content

Instantly share code, notes, and snippets.

@b2m
b2m / ner-service.py
Last active September 21, 2024 10:35
Documented FastAPI wrapper arround the NER component of the de_core_news_sm model from spaCy.
from typing import List
import spacy
import uvicorn
from fastapi import FastAPI
from pydantic import BaseModel, Field
app = FastAPI(
title="NER service based on spaCy",
description="""
@b2m
b2m / Performance-dinglehopper.md
Last active November 18, 2020 10:17
Performance benchmarking for dinglehopper using hyperfine

Performance analysis for dinglehopper using hyperfine

To estimate the impact of some changes to dinglehopper I used hyperfine to benchmark the behaviour.

The commands to run a docker container to execute the benchmarks are listed in performance-docker.sh.

The commands needed to prepare, execute and analyse the benchmark are listed in performance.sh.

@b2m
b2m / Dockerfile
Last active March 25, 2022 10:27
Put browse-ocrd into a docker container
FROM python:3.7
RUN apt-get update \
&& apt-get install -y --no-install-recommends libcairo2-dev libgtk-3-bin libgtk-3-dev libglib2.0-dev libgtksourceview-3.0-dev libgirepository1.0-dev gir1.2-webkit2-4.0 pkg-config cmake \
&& pip3 install -U setuptools --use-feature=2020-resolver \
&& pip3 install browse-ocrd --use-feature=2020-resolver
ENV GDK_BACKEND broadway
ENV BROADWAY_DISPLAY :5