text2ipc: IPC 20260101 (PT) via intfloat/multilingual-e5-base
Maps free text (a patent abstract, for example) to ranked International Patent Classification symbols. Every IPC entry is embedded from its full ancestor path and the query is scored against the hierarchy (path support, beam by best subtree score).
This repository is a custom Inference Endpoints handler (handler.py). Deploy it as
an Inference Endpoint and call:
{"inputs": "enxada manual com duas lâminas para capina",
"parameters": {"level": "group", "top_k": 5}}
level is one of section, class, subclass, group, subgroup or auto. The response is a
list of {symbol, canonical, level, score, similarity, title, path}.
Use it locally
pip install "text2ipc[st] @ git+https://github.com/jaimenms/study-text-to-ipc"
t2ipc download jaimenms/text2ipc-pt
t2ipc classify "Aparelho para combate a incêndios com mangueira flexível" --lang PT --level group
from text2ipc import IpcClassifier
clf = IpcClassifier("20260101", lang="PT")
for m in clf.classify("...", level="group", top_k=5):
print(m.pretty, round(m.score, 3), m.text)
Contents: scheme/ (titles and hierarchy), index/ (vectors, parquet), text2ipc/
(the package, vendored), text2ipc.json (which index to serve).
Data: IPC scheme master files by WIPO; Portuguese titles from INPI Brazil's IPC Publication. Embedder: intfloat/multilingual-e5-base from the Hub.
Accuracy on INPI-published applications is documented in the text2ipc repository.
Model tree for jaimenms/text2ipc-pt
Base model
intfloat/multilingual-e5-base