text2ipc IPC 20260101 FR (a1f5879)
Browse filesFiles changed (4)
15 unmodified lines1617181920212245 unmodified lines6869707172737415 unmodified linesbase_model_relation: merge---# text2ipc 0.2.3: IPC 20260101 (FR) via intfloat/multilingual-e5-baseBoth models above are listed as base models so that they show in the model tree(the Hub only has "merge" as a relation for two models): the index in this45 unmodified lines```bashpip install "text2ipc[st] @ git+https://github.com/Jaimenms/text2ipc"t2ipc download jaimenms/text2ipc-fr # or --revision v0.2.3 to pin this editiont2ipc classify "Appareil de lutte contre l'incendie avec tuyau flexible" --lang FR --level groupt2ipc classify "..." --lang FR --level group --rerank```15 unmodified lines1617181920212245 unmodified lines6869707172737415 unmodified linesbase_model_relation: merge---# text2ipc 0.2.4: IPC 20260101 (FR) via intfloat/multilingual-e5-baseBoth models above are listed as base models so that they show in the model tree(the Hub only has "merge" as a relation for two models): the index in this45 unmodified lines```bashpip install "text2ipc[st] @ git+https://github.com/Jaimenms/text2ipc"t2ipc download jaimenms/text2ipc-fr # or --revision v0.2.4 to pin this editiont2ipc classify "Appareil de lutte contre l'incendie avec tuyau flexible" --lang FR --level groupt2ipc classify "..." --lang FR --level group --rerank```
9 unmodified lines101112139 unmodified linesfrom .search import Beam, Match, SearchParams, Weights__all__ = ["LEVELS", "Beam", "IpcClassifier", "Match", "SearchParams", "Weights", "classify"]__version__ = "0.2.3"9 unmodified lines101112139 unmodified linesfrom .search import Beam, Match, SearchParams, Weights__all__ = ["LEVELS", "Beam", "IpcClassifier", "Match", "SearchParams", "Weights", "classify"]__version__ = "0.2.4"
248 unmodified lines2492502512522532542551 unmodified line257258259260261262263248 unmodified linesdef load_examples(path: Path) -> list[dict]:"""Title and abstract of each case; nothing else reaches the page."""out = []for line in Path(path).read_text(encoding="utf-8").splitlines():if not line.strip():1 unmodified linec = json.loads(line)if not (c.get("title") and c.get("abstract")):raise ValueError(f"example {c.get('id')} needs both a title and an abstract")out.append({"title": c["title"], "abstract": c["abstract"]})return out248 unmodified lines2492502512522532542552561 unmodified line258259260261262263264265266267268269270248 unmodified linesdef load_examples(path: Path) -> list[dict]:"""Language, title and abstract of each case; nothing else reaches the page. The pageshows the examples whose language matches the selected scheme."""out = []for line in Path(path).read_text(encoding="utf-8").splitlines():if not line.strip():1 unmodified linec = json.loads(line)if not (c.get("title") and c.get("abstract")):raise ValueError(f"example {c.get('id')} needs both a title and an abstract")out.append({"lang": (c.get("lang") or "pt").upper(),"title": c["title"],"abstract": c["abstract"],})return out
636 unmodified lines63763863964064164264364464528 unmodified lines6746756766776786796803 unmodified lines684685686687688689690691692636 unmodified lines}}function renderExamples() {ui.examples.innerHTML = "";for (const ex of state.examples) {const b = document.createElement("button");b.type = "button";b.className = "chip";28 unmodified linesif (!m.reranker) ui.rerankLabel.hidden = true;else ui.rerankLabel.title = `${m.reranker.web_model} (${m.reranker.dtype}) re-judges the top ${m.reranker.candidates} when you click Classify; 280 MB once, then about a second per candidate`;await loadExamples();renderExamples();const params = new URLSearchParams(location.search);if (params.get("lang") && m.indexes.some((e) => e.lang === params.get("lang"))) {3 unmodified linesui.level.value = params.get("level");}if (params.get("q")) ui.text.value = params.get("q");ui.run.addEventListener("click", classify);ui.lang.addEventListener("change", () => loadIndex(entryFor(ui.lang.value)).catch(fail));window.addEventListener("scroll", hideTip, { passive: true });try {636 unmodified lines63763863964064164264364464564664764828 unmodified lines6776786796806816823 unmodified lines686687688689690691692693694695696697698636 unmodified lines}}/** Example buttons in the language of the selected scheme (all of them as a fallback). */function renderExamples() {ui.examples.innerHTML = "";const lang = (ui.lang.value || "").toUpperCase();const matching = state.examples.filter((ex) => (ex.lang || "").toUpperCase() === lang);for (const ex of matching.length ? matching : state.examples) {const b = document.createElement("button");b.type = "button";b.className = "chip";28 unmodified linesif (!m.reranker) ui.rerankLabel.hidden = true;else ui.rerankLabel.title = `${m.reranker.web_model} (${m.reranker.dtype}) re-judges the top ${m.reranker.candidates} when you click Classify; 280 MB once, then about a second per candidate`;await loadExamples();const params = new URLSearchParams(location.search);if (params.get("lang") && m.indexes.some((e) => e.lang === params.get("lang"))) {3 unmodified linesui.level.value = params.get("level");}if (params.get("q")) ui.text.value = params.get("q");renderExamples();ui.run.addEventListener("click", classify);ui.lang.addEventListener("change", () => {renderExamples();loadIndex(entryFor(ui.lang.value)).catch(fail);});window.addEventListener("scroll", hideTip, { passive: true });try {
README.md+2-2
text2ipc/__init__.py+1-1
text2ipc/web/export.py+9-2
text2ipc/web/static/app.js+9-3