Compare commits
No commits in common. "main" and "gh-pages" have entirely different histories.
|
|
@ -1,18 +0,0 @@
|
||||||
.env
|
|
||||||
.git
|
|
||||||
.cache
|
|
||||||
.mypy_cache
|
|
||||||
.pytest_cache
|
|
||||||
.ipynb_checkpoints
|
|
||||||
.gitignore
|
|
||||||
.dockerignore
|
|
||||||
Dockerfile
|
|
||||||
.github
|
|
||||||
.vscode
|
|
||||||
docs
|
|
||||||
scripts
|
|
||||||
tests
|
|
||||||
mkdocs.yaml
|
|
||||||
**/.mypy_cache
|
|
||||||
**/__pycache__
|
|
||||||
**/tracing_database.json
|
|
||||||
|
|
@ -1,57 +0,0 @@
|
||||||
name: Publish on DockerHub
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
tags: ['*']
|
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
publish:
|
|
||||||
runs-on: docker
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
# The `docker` runner image is node-based and may not ship the docker CLI
|
|
||||||
# that the docker/* actions below drive; install it idempotently, as the
|
|
||||||
# sibling repos do for their Docker jobs.
|
|
||||||
- name: Ensure Docker CLI
|
|
||||||
run: |
|
|
||||||
set -eux
|
|
||||||
if ! command -v docker >/dev/null 2>&1; then
|
|
||||||
ARCH=$(uname -m)
|
|
||||||
curl -fsSL --retry 3 --retry-connrefused \
|
|
||||||
"https://download.docker.com/linux/static/stable/${ARCH}/docker-27.5.1.tgz" \
|
|
||||||
| tar xz --strip-components=1 -C /usr/local/bin docker/docker
|
|
||||||
fi
|
|
||||||
docker --version
|
|
||||||
|
|
||||||
# Marketplace actions must be referenced by full URL: this instance's
|
|
||||||
# DEFAULT_ACTIONS_URL points at code.forgejo.org, so only bare `actions/*`
|
|
||||||
# names resolve to GitHub automatically.
|
|
||||||
- name: Set up QEMU
|
|
||||||
uses: https://github.com/docker/setup-qemu-action@v3
|
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
|
||||||
uses: https://github.com/docker/setup-buildx-action@v3
|
|
||||||
|
|
||||||
- name: Log in to Docker Hub
|
|
||||||
uses: https://github.com/docker/login-action@v3
|
|
||||||
with:
|
|
||||||
username: ${{ secrets.DOCKER_USERNAME }}
|
|
||||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
|
||||||
|
|
||||||
- name: Extract metadata for the Docker image
|
|
||||||
id: meta
|
|
||||||
uses: https://github.com/docker/metadata-action@v5
|
|
||||||
with:
|
|
||||||
images: schmelczera/great-ai
|
|
||||||
|
|
||||||
- name: Build and push
|
|
||||||
uses: https://github.com/docker/build-push-action@v6
|
|
||||||
with:
|
|
||||||
context: .
|
|
||||||
push: true
|
|
||||||
tags: ${{ steps.meta.outputs.tags }}
|
|
||||||
labels: ${{ steps.meta.outputs.labels }}
|
|
||||||
platforms: linux/amd64,linux/arm64
|
|
||||||
|
|
@ -1,52 +0,0 @@
|
||||||
name: Publish documentation
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches: [main]
|
|
||||||
paths:
|
|
||||||
- 'docs/**'
|
|
||||||
- 'great_ai/**'
|
|
||||||
- 'mkdocs.yaml'
|
|
||||||
- '.forgejo/workflows/docs.yml'
|
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
concurrency:
|
|
||||||
group: pages
|
|
||||||
cancel-in-progress: false
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
publish:
|
|
||||||
runs-on: docker
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
# The mkdocs git-revision-date plugin reads each page's git history.
|
|
||||||
fetch-depth: 0
|
|
||||||
|
|
||||||
- name: Install uv
|
|
||||||
run: |
|
|
||||||
curl -LsSf https://astral.sh/uv/install.sh | sh
|
|
||||||
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
|
|
||||||
|
|
||||||
- name: Set up Python
|
|
||||||
run: uv python install 3.10
|
|
||||||
|
|
||||||
- name: Install dependencies
|
|
||||||
run: |
|
|
||||||
uv venv --python 3.10
|
|
||||||
uv pip install '.[dev]'
|
|
||||||
|
|
||||||
- name: Build documentation
|
|
||||||
run: |
|
|
||||||
. .venv/bin/activate
|
|
||||||
mkdocs build
|
|
||||||
|
|
||||||
# The old workflow ran `mkdocs gh-deploy` (GitHub Pages); on this instance
|
|
||||||
# built sites are rsynced into the host /pages mount that nginx serves,
|
|
||||||
# via the shared ci-actions/deploy-pages action — same as photos/reconcile.
|
|
||||||
- name: Deploy to pages mount
|
|
||||||
if: github.ref == 'refs/heads/main'
|
|
||||||
uses: http://forgejo:3000/andras/ci-actions/deploy-pages@main
|
|
||||||
with:
|
|
||||||
source: site
|
|
||||||
target: great-ai
|
|
||||||
|
|
@ -1,28 +0,0 @@
|
||||||
name: Publish on PyPI
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
tags: ['*']
|
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
publish:
|
|
||||||
runs-on: docker
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Install uv
|
|
||||||
run: |
|
|
||||||
curl -LsSf https://astral.sh/uv/install.sh | sh
|
|
||||||
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
|
|
||||||
|
|
||||||
- name: Set up Python
|
|
||||||
run: uv python install 3.10
|
|
||||||
|
|
||||||
# Forgejo cannot use PyPI trusted publishing (OIDC), so authenticate with
|
|
||||||
# an API token, the same way the sibling repos publish their packages.
|
|
||||||
- name: Build and publish
|
|
||||||
env:
|
|
||||||
FLIT_USERNAME: __token__
|
|
||||||
FLIT_PASSWORD: ${{ secrets.PYPI_TOKEN }}
|
|
||||||
run: uvx flit publish
|
|
||||||
|
|
@ -1,73 +0,0 @@
|
||||||
name: Check
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches: [main, dev]
|
|
||||||
pull_request:
|
|
||||||
branches: [main, dev]
|
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
concurrency:
|
|
||||||
group: ${{ gitea.workflow }}-${{ gitea.ref }}
|
|
||||||
cancel-in-progress: true
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
lint:
|
|
||||||
name: Lint, format & type checks
|
|
||||||
runs-on: docker
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Install uv
|
|
||||||
run: |
|
|
||||||
curl -LsSf https://astral.sh/uv/install.sh | sh
|
|
||||||
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
|
|
||||||
|
|
||||||
- name: Set up Python
|
|
||||||
run: uv python install 3.10
|
|
||||||
|
|
||||||
- name: Install dependencies
|
|
||||||
# --seed gives the venv its own pip, which scripts/check-python.sh shells
|
|
||||||
# out to for its linters; '.[dev]' provides the rest (mypy resolves the
|
|
||||||
# package's own imports against the installed tree).
|
|
||||||
run: |
|
|
||||||
uv venv --seed --python 3.10
|
|
||||||
uv pip install '.[dev]'
|
|
||||||
|
|
||||||
- name: Check code and formatting
|
|
||||||
run: |
|
|
||||||
. .venv/bin/activate
|
|
||||||
scripts/check-python.sh great_ai tests
|
|
||||||
|
|
||||||
test:
|
|
||||||
name: Test on Python ${{ matrix.python-version }}
|
|
||||||
runs-on: docker
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
# pyproject declares >= 3.7, but uv's standalone CPython and the current
|
|
||||||
# dependency floors (scikit-learn/numpy now require >= 3.9) no longer
|
|
||||||
# build on the older interpreters, so we test the current supported set.
|
|
||||||
# The windows leg of the old GitHub matrix is dropped: this Forgejo
|
|
||||||
# instance only has a Linux `docker` runner.
|
|
||||||
python-version: ['3.10', '3.11', '3.12', '3.13']
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Install uv
|
|
||||||
run: |
|
|
||||||
curl -LsSf https://astral.sh/uv/install.sh | sh
|
|
||||||
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
|
|
||||||
|
|
||||||
- name: Set up Python ${{ matrix.python-version }}
|
|
||||||
run: uv python install ${{ matrix.python-version }}
|
|
||||||
|
|
||||||
- name: Install dependencies
|
|
||||||
run: |
|
|
||||||
uv venv --python ${{ matrix.python-version }}
|
|
||||||
uv pip install '.[dev]'
|
|
||||||
|
|
||||||
- name: Run tests
|
|
||||||
run: |
|
|
||||||
. .venv/bin/activate
|
|
||||||
pytest --doctest-modules --asyncio-mode=strict
|
|
||||||
12
.gitignore
vendored
|
|
@ -1,12 +0,0 @@
|
||||||
.env
|
|
||||||
.venv
|
|
||||||
.DS_Store
|
|
||||||
__pycache__
|
|
||||||
.cache
|
|
||||||
.mypy_cache
|
|
||||||
.pytest_cache
|
|
||||||
.ipynb_checkpoints
|
|
||||||
*.egg-info
|
|
||||||
build
|
|
||||||
tracing_database.json
|
|
||||||
.tox
|
|
||||||
84
.vscode/settings.json
vendored
|
|
@ -1,84 +0,0 @@
|
||||||
{
|
|
||||||
"cSpell.words": [
|
|
||||||
"alru",
|
|
||||||
"Analyse",
|
|
||||||
"András",
|
|
||||||
"basereload",
|
|
||||||
"boto",
|
|
||||||
"botocore",
|
|
||||||
"Convolutional",
|
|
||||||
"datatable",
|
|
||||||
"deduplicated",
|
|
||||||
"displaylogo",
|
|
||||||
"downsample",
|
|
||||||
"fastapi",
|
|
||||||
"finalise",
|
|
||||||
"finalised",
|
|
||||||
"gridfs",
|
|
||||||
"httpx",
|
|
||||||
"iloc",
|
|
||||||
"initialisation",
|
|
||||||
"initialised",
|
|
||||||
"initialising",
|
|
||||||
"inplace",
|
|
||||||
"ipynb",
|
|
||||||
"langcodes",
|
|
||||||
"lemmatize",
|
|
||||||
"levelname",
|
|
||||||
"levelno",
|
|
||||||
"matplotlib",
|
|
||||||
"miniters",
|
|
||||||
"Multinomial",
|
|
||||||
"multiprocess",
|
|
||||||
"nbconvert",
|
|
||||||
"nbins",
|
|
||||||
"optimisation",
|
|
||||||
"organisation's",
|
|
||||||
"Parcoords",
|
|
||||||
"plotly",
|
|
||||||
"pretrained",
|
|
||||||
"proba",
|
|
||||||
"pydantic",
|
|
||||||
"pymongo",
|
|
||||||
"pyplot",
|
|
||||||
"redoc",
|
|
||||||
"scibert",
|
|
||||||
"serialise",
|
|
||||||
"sklearn",
|
|
||||||
"starlette",
|
|
||||||
"sublinear",
|
|
||||||
"syntok",
|
|
||||||
"Tfidf",
|
|
||||||
"threadsafe",
|
|
||||||
"ticktext",
|
|
||||||
"tickvals",
|
|
||||||
"tinydb",
|
|
||||||
"tqdm",
|
|
||||||
"unchunk",
|
|
||||||
"uvicorn",
|
|
||||||
"Vectorizer",
|
|
||||||
"xmargin",
|
|
||||||
"xticks"
|
|
||||||
],
|
|
||||||
"files.exclude": {
|
|
||||||
".env": true,
|
|
||||||
"**/__pycache__": true,
|
|
||||||
"**/.ipynb_checkpoints": true,
|
|
||||||
"**/.mypy_cache": true,
|
|
||||||
"**/.pytest_cache": true,
|
|
||||||
"**/*.egg-info": true,
|
|
||||||
"**/*.cache": true,
|
|
||||||
"**/*.tox": true,
|
|
||||||
"**/tracing_database.json": true
|
|
||||||
},
|
|
||||||
"notebook.output.textLineLimit": 400,
|
|
||||||
"python.defaultInterpreterPath": ".env/bin/python",
|
|
||||||
"python.testing.pytestArgs": ["tests"],
|
|
||||||
"editor.rulers": [88],
|
|
||||||
"python.linting.flake8Enabled": false,
|
|
||||||
"python.linting.pylintEnabled": false,
|
|
||||||
"python.linting.mypyEnabled": true,
|
|
||||||
"python.testing.unittestEnabled": false,
|
|
||||||
"python.testing.pytestEnabled": true,
|
|
||||||
"editor.wordWrap": "on"
|
|
||||||
}
|
|
||||||
56
.vscode/tasks.json
vendored
|
|
@ -1,56 +0,0 @@
|
||||||
{
|
|
||||||
"version": "2.0.0",
|
|
||||||
"tasks": [
|
|
||||||
{
|
|
||||||
"label": "Format and lint",
|
|
||||||
"type": "shell",
|
|
||||||
"command": "source .env/bin/activate && scripts/format-python.sh great_ai docs tests",
|
|
||||||
"windows": {
|
|
||||||
"command": ".env\\bin\\activate.bat; scripts\\format-python.sh great_ai docs tests"
|
|
||||||
},
|
|
||||||
"group": "test",
|
|
||||||
"presentation": {
|
|
||||||
"reveal": "always",
|
|
||||||
"showReuseMessage": false,
|
|
||||||
"panel": "shared"
|
|
||||||
},
|
|
||||||
"options": {
|
|
||||||
"cwd": "${workspaceFolder}"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"label": "Test (quick)",
|
|
||||||
"type": "shell",
|
|
||||||
"command": "source .env/bin/activate && python3 -m pytest . --doctest-modules --asyncio-mode=strict",
|
|
||||||
"windows": {
|
|
||||||
"command": ".env\\bin\\activate.bat; python3 -m pytest . --doctest-modules --asyncio-mode=strict"
|
|
||||||
},
|
|
||||||
"group": "test",
|
|
||||||
"presentation": {
|
|
||||||
"reveal": "always",
|
|
||||||
"showReuseMessage": false,
|
|
||||||
"panel": "shared"
|
|
||||||
},
|
|
||||||
"options": {
|
|
||||||
"cwd": "${workspaceFolder}"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"label": "Test (all Python versions)",
|
|
||||||
"type": "shell",
|
|
||||||
"command": "source .env/bin/activate && python3 -m tox",
|
|
||||||
"windows": {
|
|
||||||
"command": ".env\\bin\\activate.bat; python3 -m tox"
|
|
||||||
},
|
|
||||||
"group": "test",
|
|
||||||
"presentation": {
|
|
||||||
"reveal": "always",
|
|
||||||
"showReuseMessage": false,
|
|
||||||
"panel": "shared"
|
|
||||||
},
|
|
||||||
"options": {
|
|
||||||
"cwd": "${workspaceFolder}"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
875
404.html
Normal file
|
|
@ -0,0 +1,875 @@
|
||||||
|
|
||||||
|
<!doctype html>
|
||||||
|
<html lang="en" class="no-js">
|
||||||
|
<head>
|
||||||
|
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||||
|
|
||||||
|
<meta name="description" content="GreatAI helps you easily transform your prototype AI code into production-ready software.">
|
||||||
|
|
||||||
|
|
||||||
|
<meta name="author" content="András Schmelczer">
|
||||||
|
|
||||||
|
|
||||||
|
<link rel="icon" href="/media/favicon.ico">
|
||||||
|
<meta name="generator" content="mkdocs-1.4.2, mkdocs-material-8.5.8">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<title>GreatAI documentation</title>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<link rel="stylesheet" href="/assets/stylesheets/main.20d9efc8.min.css">
|
||||||
|
|
||||||
|
|
||||||
|
<link rel="stylesheet" href="/assets/stylesheets/palette.815d1a91.min.css">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||||
|
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,300i,400,400i,700,700i%7CRoboto+Mono:400,400i,700,700i&display=fallback">
|
||||||
|
<style>:root{--md-text-font:"Roboto";--md-code-font:"Roboto Mono"}</style>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<link rel="stylesheet" href="/assets/_mkdocstrings.css">
|
||||||
|
|
||||||
|
<script>__md_scope=new URL("/",location),__md_hash=e=>[...e].reduce((e,_)=>(e<<5)-e+_.charCodeAt(0),0),__md_get=(e,_=localStorage,t=__md_scope)=>JSON.parse(_.getItem(t.pathname+"."+e)),__md_set=(e,_,t=localStorage,a=__md_scope)=>{try{t.setItem(a.pathname+"."+e,JSON.stringify(_))}catch(e){}}</script>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<meta property="og:title" content="">
|
||||||
|
<meta property="og:site_name" content="">
|
||||||
|
<meta property="og:url" content="">
|
||||||
|
<meta property="og:description" content="Transform your prototype AI code into production-ready software.">
|
||||||
|
<meta property="og:type" content="">
|
||||||
|
<meta property="og:image" content=https://great-ai.scoutinscience.com/media/og-image.png>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
.jupyter-wrapper a {
|
||||||
|
color: var(--md-typeset-a-color) !important;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
|
</head>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<body dir="ltr" data-md-color-scheme="default" data-md-color-primary="light-blue" data-md-color-accent="">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<script>var palette=__md_get("__palette");if(palette&&"object"==typeof palette.color)for(var key of Object.keys(palette.color))document.body.setAttribute("data-md-color-"+key,palette.color[key])</script>
|
||||||
|
|
||||||
|
<input class="md-toggle" data-md-toggle="drawer" type="checkbox" id="__drawer" autocomplete="off">
|
||||||
|
<input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
|
||||||
|
<label class="md-overlay" for="__drawer"></label>
|
||||||
|
<div data-md-component="skip">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div data-md-component="announce">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<header class="md-header" data-md-component="header">
|
||||||
|
<nav class="md-header__inner md-grid" aria-label="Header">
|
||||||
|
<a href="/." title="GreatAI documentation" class="md-header__button md-logo" aria-label="GreatAI documentation" data-md-component="logo">
|
||||||
|
|
||||||
|
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 8a3 3 0 0 0 3-3 3 3 0 0 0-3-3 3 3 0 0 0-3 3 3 3 0 0 0 3 3m0 3.54C9.64 9.35 6.5 8 3 8v11c3.5 0 6.64 1.35 9 3.54 2.36-2.19 5.5-3.54 9-3.54V8c-3.5 0-6.64 1.35-9 3.54Z"/></svg>
|
||||||
|
|
||||||
|
</a>
|
||||||
|
<label class="md-header__button md-icon" for="__drawer">
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3 6h18v2H3V6m0 5h18v2H3v-2m0 5h18v2H3v-2Z"/></svg>
|
||||||
|
</label>
|
||||||
|
<div class="md-header__title" data-md-component="header-title">
|
||||||
|
<div class="md-header__ellipsis">
|
||||||
|
<div class="md-header__topic">
|
||||||
|
<span class="md-ellipsis">
|
||||||
|
GreatAI documentation
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<div class="md-header__topic" data-md-component="header-topic">
|
||||||
|
<span class="md-ellipsis">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<form class="md-header__option" data-md-component="palette">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<input class="md-option" data-md-color-media="(prefers-color-scheme: light)" data-md-color-scheme="default" data-md-color-primary="light-blue" data-md-color-accent="" aria-label="Switch to dark mode" type="radio" name="__palette" id="__palette_1">
|
||||||
|
|
||||||
|
<label class="md-header__button md-icon" title="Switch to dark mode" for="__palette_2" hidden>
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 2a7 7 0 0 0-7 7c0 2.38 1.19 4.47 3 5.74V17a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1v-2.26c1.81-1.27 3-3.36 3-5.74a7 7 0 0 0-7-7M9 21a1 1 0 0 0 1 1h4a1 1 0 0 0 1-1v-1H9v1Z"/></svg>
|
||||||
|
</label>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<input class="md-option" data-md-color-media="(prefers-color-scheme: dark)" data-md-color-scheme="slate" data-md-color-primary="light-blue" data-md-color-accent="" aria-label="Switch to light mode" type="radio" name="__palette" id="__palette_2">
|
||||||
|
|
||||||
|
<label class="md-header__button md-icon" title="Switch to light mode" for="__palette_1" hidden>
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 2a7 7 0 0 1 7 7c0 2.38-1.19 4.47-3 5.74V17a1 1 0 0 1-1 1H9a1 1 0 0 1-1-1v-2.26C6.19 13.47 5 11.38 5 9a7 7 0 0 1 7-7M9 21v-1h6v1a1 1 0 0 1-1 1h-4a1 1 0 0 1-1-1m3-17a5 5 0 0 0-5 5c0 2.05 1.23 3.81 3 4.58V16h4v-2.42c1.77-.77 3-2.53 3-4.58a5 5 0 0 0-5-5Z"/></svg>
|
||||||
|
</label>
|
||||||
|
|
||||||
|
|
||||||
|
</form>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<label class="md-header__button md-icon" for="__search">
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9.5 3A6.5 6.5 0 0 1 16 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.516 6.516 0 0 1 9.5 16 6.5 6.5 0 0 1 3 9.5 6.5 6.5 0 0 1 9.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 5Z"/></svg>
|
||||||
|
</label>
|
||||||
|
<div class="md-search" data-md-component="search" role="dialog">
|
||||||
|
<label class="md-search__overlay" for="__search"></label>
|
||||||
|
<div class="md-search__inner" role="search">
|
||||||
|
<form class="md-search__form" name="search">
|
||||||
|
<input type="text" class="md-search__input" name="query" aria-label="Search" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="search-query" required>
|
||||||
|
<label class="md-search__icon md-icon" for="__search">
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9.5 3A6.5 6.5 0 0 1 16 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.516 6.516 0 0 1 9.5 16 6.5 6.5 0 0 1 3 9.5 6.5 6.5 0 0 1 9.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 5Z"/></svg>
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11h12Z"/></svg>
|
||||||
|
</label>
|
||||||
|
<nav class="md-search__options" aria-label="Search">
|
||||||
|
|
||||||
|
<button type="reset" class="md-search__icon md-icon" title="Clear" aria-label="Clear" tabindex="-1">
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41Z"/></svg>
|
||||||
|
</button>
|
||||||
|
</nav>
|
||||||
|
|
||||||
|
</form>
|
||||||
|
<div class="md-search__output">
|
||||||
|
<div class="md-search__scrollwrap" data-md-scrollfix>
|
||||||
|
<div class="md-search-result" data-md-component="search-result">
|
||||||
|
<div class="md-search-result__meta">
|
||||||
|
Initializing search
|
||||||
|
</div>
|
||||||
|
<ol class="md-search-result__list"></ol>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="md-header__source">
|
||||||
|
<a href="https://github.com/schmelczer/great-ai" title="Go to repository" class="md-source" data-md-component="source">
|
||||||
|
<div class="md-source__icon md-icon">
|
||||||
|
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--! Font Awesome Free 6.2.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2022 Fonticons, Inc.--><path d="M439.55 236.05 244 40.45a28.87 28.87 0 0 0-40.81 0l-40.66 40.63 51.52 51.52c27.06-9.14 52.68 16.77 43.39 43.68l49.66 49.66c34.23-11.8 61.18 31 35.47 56.69-26.49 26.49-70.21-2.87-56-37.34L240.22 199v121.85c25.3 12.54 22.26 41.85 9.08 55a34.34 34.34 0 0 1-48.55 0c-17.57-17.6-11.07-46.91 11.25-56v-123c-20.8-8.51-24.6-30.74-18.64-45L142.57 101 8.45 235.14a28.86 28.86 0 0 0 0 40.81l195.61 195.6a28.86 28.86 0 0 0 40.8 0l194.69-194.69a28.86 28.86 0 0 0 0-40.81z"/></svg>
|
||||||
|
</div>
|
||||||
|
<div class="md-source__repository">
|
||||||
|
schmelczer/great-ai
|
||||||
|
</div>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</nav>
|
||||||
|
|
||||||
|
</header>
|
||||||
|
|
||||||
|
<div class="md-container" data-md-component="container">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<main class="md-main" data-md-component="main">
|
||||||
|
<div class="md-main__inner md-grid">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<div class="md-sidebar md-sidebar--primary" data-md-component="sidebar" data-md-type="navigation" >
|
||||||
|
<div class="md-sidebar__scrollwrap">
|
||||||
|
<div class="md-sidebar__inner">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<nav class="md-nav md-nav--primary" aria-label="Navigation" data-md-level="0">
|
||||||
|
<label class="md-nav__title" for="__drawer">
|
||||||
|
<a href="/." title="GreatAI documentation" class="md-nav__button md-logo" aria-label="GreatAI documentation" data-md-component="logo">
|
||||||
|
|
||||||
|
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 8a3 3 0 0 0 3-3 3 3 0 0 0-3-3 3 3 0 0 0-3 3 3 3 0 0 0 3 3m0 3.54C9.64 9.35 6.5 8 3 8v11c3.5 0 6.64 1.35 9 3.54 2.36-2.19 5.5-3.54 9-3.54V8c-3.5 0-6.64 1.35-9 3.54Z"/></svg>
|
||||||
|
|
||||||
|
</a>
|
||||||
|
GreatAI documentation
|
||||||
|
</label>
|
||||||
|
|
||||||
|
<div class="md-nav__source">
|
||||||
|
<a href="https://github.com/schmelczer/great-ai" title="Go to repository" class="md-source" data-md-component="source">
|
||||||
|
<div class="md-source__icon md-icon">
|
||||||
|
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--! Font Awesome Free 6.2.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2022 Fonticons, Inc.--><path d="M439.55 236.05 244 40.45a28.87 28.87 0 0 0-40.81 0l-40.66 40.63 51.52 51.52c27.06-9.14 52.68 16.77 43.39 43.68l49.66 49.66c34.23-11.8 61.18 31 35.47 56.69-26.49 26.49-70.21-2.87-56-37.34L240.22 199v121.85c25.3 12.54 22.26 41.85 9.08 55a34.34 34.34 0 0 1-48.55 0c-17.57-17.6-11.07-46.91 11.25-56v-123c-20.8-8.51-24.6-30.74-18.64-45L142.57 101 8.45 235.14a28.86 28.86 0 0 0 0 40.81l195.61 195.6a28.86 28.86 0 0 0 40.8 0l194.69-194.69a28.86 28.86 0 0 0 0-40.81z"/></svg>
|
||||||
|
</div>
|
||||||
|
<div class="md-source__repository">
|
||||||
|
schmelczer/great-ai
|
||||||
|
</div>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<ul class="md-nav__list" data-md-scrollfix>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="/." class="md-nav__link">
|
||||||
|
Overview
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<li class="md-nav__item md-nav__item--nested">
|
||||||
|
|
||||||
|
|
||||||
|
<input class="md-nav__toggle md-toggle" data-md-toggle="__nav_2" type="checkbox" id="__nav_2" >
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<label class="md-nav__link" for="__nav_2">
|
||||||
|
Tutorial
|
||||||
|
<span class="md-nav__icon md-icon"></span>
|
||||||
|
</label>
|
||||||
|
|
||||||
|
<nav class="md-nav" aria-label="Tutorial" data-md-level="1">
|
||||||
|
<label class="md-nav__title" for="__nav_2">
|
||||||
|
<span class="md-nav__icon md-icon"></span>
|
||||||
|
Tutorial
|
||||||
|
</label>
|
||||||
|
<ul class="md-nav__list" data-md-scrollfix>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="/tutorial/" class="md-nav__link">
|
||||||
|
Tutorial overview
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="/tutorial/train/" class="md-nav__link">
|
||||||
|
Train your model
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="/tutorial/deploy/" class="md-nav__link">
|
||||||
|
Harden and deploy your app
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</ul>
|
||||||
|
</nav>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<li class="md-nav__item md-nav__item--nested">
|
||||||
|
|
||||||
|
|
||||||
|
<input class="md-nav__toggle md-toggle" data-md-toggle="__nav_3" type="checkbox" id="__nav_3" >
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<label class="md-nav__link" for="__nav_3">
|
||||||
|
User Guides
|
||||||
|
<span class="md-nav__icon md-icon"></span>
|
||||||
|
</label>
|
||||||
|
|
||||||
|
<nav class="md-nav" aria-label="User Guides" data-md-level="1">
|
||||||
|
<label class="md-nav__title" for="__nav_3">
|
||||||
|
<span class="md-nav__icon md-icon"></span>
|
||||||
|
User Guides
|
||||||
|
</label>
|
||||||
|
<ul class="md-nav__list" data-md-scrollfix>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="/how-to-guides/install/" class="md-nav__link">
|
||||||
|
Installation guide
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="/how-to-guides/create-service/" class="md-nav__link">
|
||||||
|
How to create a GreatAI service
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="/how-to-guides/configure-service/" class="md-nav__link">
|
||||||
|
How to configure GreatAI
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="/how-to-guides/use-service/" class="md-nav__link">
|
||||||
|
How to perform prediction with GreatAI
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="/how-to-guides/handle-training-data/" class="md-nav__link">
|
||||||
|
How to manage training data
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="/how-to-guides/large-file/" class="md-nav__link">
|
||||||
|
How to use LargeFiles
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="/how-to-guides/call-remote/" class="md-nav__link">
|
||||||
|
How to call remote GreatAI instances
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</ul>
|
||||||
|
</nav>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<li class="md-nav__item md-nav__item--nested">
|
||||||
|
|
||||||
|
|
||||||
|
<input class="md-nav__toggle md-toggle" data-md-toggle="__nav_4" type="checkbox" id="__nav_4" >
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<label class="md-nav__link" for="__nav_4">
|
||||||
|
Reference
|
||||||
|
<span class="md-nav__icon md-icon"></span>
|
||||||
|
</label>
|
||||||
|
|
||||||
|
<nav class="md-nav" aria-label="Reference" data-md-level="1">
|
||||||
|
<label class="md-nav__title" for="__nav_4">
|
||||||
|
<span class="md-nav__icon md-icon"></span>
|
||||||
|
Reference
|
||||||
|
</label>
|
||||||
|
<ul class="md-nav__list" data-md-scrollfix>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="/reference/" class="md-nav__link">
|
||||||
|
GreatAI reference
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="/reference/utilities/" class="md-nav__link">
|
||||||
|
Utilities
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="/reference/large-file/" class="md-nav__link">
|
||||||
|
LargeFile
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="/reference/views/" class="md-nav__link">
|
||||||
|
View models
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</ul>
|
||||||
|
</nav>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<li class="md-nav__item md-nav__item--nested">
|
||||||
|
|
||||||
|
|
||||||
|
<input class="md-nav__toggle md-toggle" data-md-toggle="__nav_5" type="checkbox" id="__nav_5" >
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<label class="md-nav__link" for="__nav_5">
|
||||||
|
Examples
|
||||||
|
<span class="md-nav__icon md-icon"></span>
|
||||||
|
</label>
|
||||||
|
|
||||||
|
<nav class="md-nav" aria-label="Examples" data-md-level="1">
|
||||||
|
<label class="md-nav__title" for="__nav_5">
|
||||||
|
<span class="md-nav__icon md-icon"></span>
|
||||||
|
Examples
|
||||||
|
</label>
|
||||||
|
<ul class="md-nav__list" data-md-scrollfix>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<li class="md-nav__item md-nav__item--nested">
|
||||||
|
|
||||||
|
|
||||||
|
<input class="md-nav__toggle md-toggle" data-md-toggle="__nav_5_1" type="checkbox" id="__nav_5_1" >
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<label class="md-nav__link" for="__nav_5_1">
|
||||||
|
Explainable Naive Bayes
|
||||||
|
<span class="md-nav__icon md-icon"></span>
|
||||||
|
</label>
|
||||||
|
|
||||||
|
<nav class="md-nav" aria-label="Explainable Naive Bayes" data-md-level="2">
|
||||||
|
<label class="md-nav__title" for="__nav_5_1">
|
||||||
|
<span class="md-nav__icon md-icon"></span>
|
||||||
|
Explainable Naive Bayes
|
||||||
|
</label>
|
||||||
|
<ul class="md-nav__list" data-md-scrollfix>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="/examples/simple/data/" class="md-nav__link">
|
||||||
|
Simple example: data engineering
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="/examples/simple/train/" class="md-nav__link">
|
||||||
|
Optimise and train a model
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="/examples/simple/deploy/" class="md-nav__link">
|
||||||
|
Hardening and deployment
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</ul>
|
||||||
|
</nav>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<li class="md-nav__item md-nav__item--nested">
|
||||||
|
|
||||||
|
|
||||||
|
<input class="md-nav__toggle md-toggle" data-md-toggle="__nav_5_2" type="checkbox" id="__nav_5_2" >
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<label class="md-nav__link" for="__nav_5_2">
|
||||||
|
Explainable SciBERT
|
||||||
|
<span class="md-nav__icon md-icon"></span>
|
||||||
|
</label>
|
||||||
|
|
||||||
|
<nav class="md-nav" aria-label="Explainable SciBERT" data-md-level="2">
|
||||||
|
<label class="md-nav__title" for="__nav_5_2">
|
||||||
|
<span class="md-nav__icon md-icon"></span>
|
||||||
|
Explainable SciBERT
|
||||||
|
</label>
|
||||||
|
<ul class="md-nav__list" data-md-scrollfix>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="/examples/scibert/" class="md-nav__link">
|
||||||
|
Summarising scientific publications from a tech-transfer perspective
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="/examples/scibert/data/" class="md-nav__link">
|
||||||
|
Explore data and feasibility of approach
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="/examples/scibert/train/" class="md-nav__link">
|
||||||
|
Fine-tune SciBERT
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="/examples/scibert/deploy/" class="md-nav__link">
|
||||||
|
Create an inference function
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="/examples/scibert/additional-files/" class="md-nav__link">
|
||||||
|
Additional files in the repository
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</ul>
|
||||||
|
</nav>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</ul>
|
||||||
|
</nav>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="/explanation/" class="md-nav__link">
|
||||||
|
Explanation
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</ul>
|
||||||
|
</nav>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<div class="md-sidebar md-sidebar--secondary" data-md-component="sidebar" data-md-type="toc" >
|
||||||
|
<div class="md-sidebar__scrollwrap">
|
||||||
|
<div class="md-sidebar__inner">
|
||||||
|
|
||||||
|
|
||||||
|
<nav class="md-nav md-nav--secondary" aria-label="Table of contents">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</nav>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<div class="md-content" data-md-component="content">
|
||||||
|
<article class="md-content__inner md-typeset">
|
||||||
|
|
||||||
|
<h1>404 - Not found</h1>
|
||||||
|
|
||||||
|
</article>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</main>
|
||||||
|
|
||||||
|
<footer class="md-footer">
|
||||||
|
|
||||||
|
<div class="md-footer-meta md-typeset">
|
||||||
|
<div class="md-footer-meta__inner md-grid">
|
||||||
|
<div class="md-copyright">
|
||||||
|
|
||||||
|
<div class="md-copyright__highlight">
|
||||||
|
GNU General Public License v3
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="md-social">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a href="https://schmelczer.dev" target="_blank" rel="noopener" title="about the author" class="md-social__link">
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512"><!--! Font Awesome Free 6.2.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2022 Fonticons, Inc.--><path d="M392.8 1.2c-17-4.9-34.7 5-39.6 22l-128 448c-4.9 17 5 34.7 22 39.6s34.7-5 39.6-22l128-448c4.9-17-5-34.7-22-39.6zm80.6 120.1c-12.5 12.5-12.5 32.8 0 45.3l89.3 89.4-89.4 89.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l112-112c12.5-12.5 12.5-32.8 0-45.3l-112-112c-12.5-12.5-32.8-12.5-45.3 0zm-306.7 0c-12.5-12.5-32.8-12.5-45.3 0l-112 112c-12.5 12.5-12.5 32.8 0 45.3l112 112c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L77.3 256l89.4-89.4c12.5-12.5 12.5-32.8 0-45.3z"/></svg>
|
||||||
|
</a>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a href="https://github.com/schmelczer/great-ai" target="_blank" rel="noopener" title="great-ai on Github" class="md-social__link">
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 496 512"><!--! Font Awesome Free 6.2.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2022 Fonticons, Inc.--><path d="M165.9 397.4c0 2-2.3 3.6-5.2 3.6-3.3.3-5.6-1.3-5.6-3.6 0-2 2.3-3.6 5.2-3.6 3-.3 5.6 1.3 5.6 3.6zm-31.1-4.5c-.7 2 1.3 4.3 4.3 4.9 2.6 1 5.6 0 6.2-2s-1.3-4.3-4.3-5.2c-2.6-.7-5.5.3-6.2 2.3zm44.2-1.7c-2.9.7-4.9 2.6-4.6 4.9.3 2 2.9 3.3 5.9 2.6 2.9-.7 4.9-2.6 4.6-4.6-.3-1.9-3-3.2-5.9-2.9zM244.8 8C106.1 8 0 113.3 0 252c0 110.9 69.8 205.8 169.5 239.2 12.8 2.3 17.3-5.6 17.3-12.1 0-6.2-.3-40.4-.3-61.4 0 0-70 15-84.7-29.8 0 0-11.4-29.1-27.8-36.6 0 0-22.9-15.7 1.6-15.4 0 0 24.9 2 38.6 25.8 21.9 38.6 58.6 27.5 72.9 20.9 2.3-16 8.8-27.1 16-33.7-55.9-6.2-112.3-14.3-112.3-110.5 0-27.5 7.6-41.3 23.6-58.9-2.6-6.5-11.1-33.3 2.6-67.9 20.9-6.5 69 27 69 27 20-5.6 41.5-8.5 62.8-8.5s42.8 2.9 62.8 8.5c0 0 48.1-33.6 69-27 13.7 34.7 5.2 61.4 2.6 67.9 16 17.7 25.8 31.5 25.8 58.9 0 96.5-58.9 104.2-114.8 110.5 9.2 7.9 17 22.9 17 46.4 0 33.7-.3 75.4-.3 83.6 0 6.5 4.6 14.4 17.3 12.1C428.2 457.8 496 362.9 496 252 496 113.3 383.5 8 244.8 8zM97.2 352.9c-1.3 1-1 3.3.7 5.2 1.6 1.6 3.9 2.3 5.2 1 1.3-1 1-3.3-.7-5.2-1.6-1.6-3.9-2.3-5.2-1zm-10.8-8.1c-.7 1.3.3 2.9 2.3 3.9 1.6 1 3.6.7 4.3-.7.7-1.3-.3-2.9-2.3-3.9-2-.6-3.6-.3-4.3.7zm32.4 35.6c-1.6 1.3-1 4.3 1.3 6.2 2.3 2.3 5.2 2.6 6.5 1 1.3-1.3.7-4.3-1.3-6.2-2.2-2.3-5.2-2.6-6.5-1zm-11.4-14.7c-1.6 1-1.6 3.6 0 5.9 1.6 2.3 4.3 3.3 5.6 2.3 1.6-1.3 1.6-3.9 0-6.2-1.4-2.3-4-3.3-5.6-2z"/></svg>
|
||||||
|
</a>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a href="https://hub.docker.com/repository/docker/schmelczera/great-ai" target="_blank" rel="noopener" title="great-ai on DockerHub" class="md-social__link">
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512"><!--! Font Awesome Free 6.2.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2022 Fonticons, Inc.--><path d="M349.9 236.3h-66.1v-59.4h66.1v59.4zm0-204.3h-66.1v60.7h66.1V32zm78.2 144.8H362v59.4h66.1v-59.4zm-156.3-72.1h-66.1v60.1h66.1v-60.1zm78.1 0h-66.1v60.1h66.1v-60.1zm276.8 100c-14.4-9.7-47.6-13.2-73.1-8.4-3.3-24-16.7-44.9-41.1-63.7l-14-9.3-9.3 14c-18.4 27.8-23.4 73.6-3.7 103.8-8.7 4.7-25.8 11.1-48.4 10.7H2.4c-8.7 50.8 5.8 116.8 44 162.1 37.1 43.9 92.7 66.2 165.4 66.2 157.4 0 273.9-72.5 328.4-204.2 21.4.4 67.6.1 91.3-45.2 1.5-2.5 6.6-13.2 8.5-17.1l-13.3-8.9zm-511.1-27.9h-66v59.4h66.1v-59.4zm78.1 0h-66.1v59.4h66.1v-59.4zm78.1 0h-66.1v59.4h66.1v-59.4zm-78.1-72.1h-66.1v60.1h66.1v-60.1z"/></svg>
|
||||||
|
</a>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a href="https://pypi.org/project/great-ai" target="_blank" rel="noopener" title="great-ai on PyPI" class="md-social__link">
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--! Font Awesome Free 6.2.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2022 Fonticons, Inc.--><path d="M439.8 200.5c-7.7-30.9-22.3-54.2-53.4-54.2h-40.1v47.4c0 36.8-31.2 67.8-66.8 67.8H172.7c-29.2 0-53.4 25-53.4 54.3v101.8c0 29 25.2 46 53.4 54.3 33.8 9.9 66.3 11.7 106.8 0 26.9-7.8 53.4-23.5 53.4-54.3v-40.7H226.2v-13.6h160.2c31.1 0 42.6-21.7 53.4-54.2 11.2-33.5 10.7-65.7 0-108.6zM286.2 404c11.1 0 20.1 9.1 20.1 20.3 0 11.3-9 20.4-20.1 20.4-11 0-20.1-9.2-20.1-20.4.1-11.3 9.1-20.3 20.1-20.3zM167.8 248.1h106.8c29.7 0 53.4-24.5 53.4-54.3V91.9c0-29-24.4-50.7-53.4-55.6-35.8-5.9-74.7-5.6-106.8.1-45.2 8-53.4 24.7-53.4 55.6v40.7h106.9v13.6h-147c-31.1 0-58.3 18.7-66.8 54.2-9.8 40.7-10.2 66.1 0 108.6 7.6 31.6 25.7 54.2 56.8 54.2H101v-48.8c0-35.3 30.5-66.4 66.8-66.4zm-6.7-142.6c-11.1 0-20.1-9.1-20.1-20.3.1-11.3 9-20.4 20.1-20.4 11 0 20.1 9.2 20.1 20.4s-9 20.3-20.1 20.3z"/></svg>
|
||||||
|
</a>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</footer>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="md-dialog" data-md-component="dialog">
|
||||||
|
<div class="md-dialog__inner md-typeset"></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script id="__config" type="application/json">{"base": "/", "features": ["content.code.annotate", "content.tooltips"], "search": "/assets/javascripts/workers/search.16e2a7d4.min.js", "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.config.lang": "en", "search.config.pipeline": "trimmer, stopWordFilter", "search.config.separator": "[\\s\\-]+", "search.placeholder": "Search", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version.title": "Select version"}}</script>
|
||||||
|
|
||||||
|
|
||||||
|
<script src="/assets/javascripts/bundle.d6c3db9e.min.js"></script>
|
||||||
|
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
46
Dockerfile
|
|
@ -1,46 +0,0 @@
|
||||||
# syntax=docker/dockerfile:1.4
|
|
||||||
FROM python:3.10.4-slim-bullseye
|
|
||||||
|
|
||||||
LABEL org.opencontainers.image.title="GreatAI package wrapper image"
|
|
||||||
LABEL org.opencontainers.image.vendor="ScoutinScience B.V."
|
|
||||||
LABEL org.opencontainers.image.authors="andras@schmelczer.dev"
|
|
||||||
LABEL org.opencontainers.image.source="https://github.com/schmelczer/great-ai"
|
|
||||||
|
|
||||||
SHELL ["/bin/bash", "-c"]
|
|
||||||
|
|
||||||
ENV ENVIRONMENT=production
|
|
||||||
|
|
||||||
# curl is needed for the healthcheck
|
|
||||||
# build-essentials are needed for building packages
|
|
||||||
RUN DEBIAN_FRONTEND=noninteractive apt update &&\
|
|
||||||
apt install curl build-essential -y &&\
|
|
||||||
rm -rf /var/lib/apt/lists/*
|
|
||||||
|
|
||||||
WORKDIR /dependencies
|
|
||||||
COPY . great_ai
|
|
||||||
RUN python3 -m pip --no-cache-dir install --upgrade pip &&\
|
|
||||||
pip install --no-cache-dir ./great_ai &&\
|
|
||||||
rm -rf great_ai
|
|
||||||
|
|
||||||
HEALTHCHECK \
|
|
||||||
--interval=30s \
|
|
||||||
--timeout=180s \
|
|
||||||
--start-period=60s \
|
|
||||||
--retries=5 \
|
|
||||||
CMD [ "curl", "--fail", "http://localhost:6060/health" ]
|
|
||||||
|
|
||||||
WORKDIR /app
|
|
||||||
COPY <<EOF hello_world.py
|
|
||||||
from great_ai import GreatAI
|
|
||||||
\
|
|
||||||
@GreatAI.create
|
|
||||||
def hello_world(name: str) -> str:
|
|
||||||
"""Learn more about GreatAI at https://great-ai.scoutinscience.com"""
|
|
||||||
return f"Hello {name}!"
|
|
||||||
EOF
|
|
||||||
|
|
||||||
EXPOSE 6060
|
|
||||||
VOLUME /app
|
|
||||||
|
|
||||||
ENTRYPOINT ["/usr/local/bin/python3", "-m", "great_ai"]
|
|
||||||
CMD ["hello_world.py"]
|
|
||||||
674
LICENSE
|
|
@ -1,674 +0,0 @@
|
||||||
GNU GENERAL PUBLIC LICENSE
|
|
||||||
Version 3, 29 June 2007
|
|
||||||
|
|
||||||
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
|
||||||
Everyone is permitted to copy and distribute verbatim copies
|
|
||||||
of this license document, but changing it is not allowed.
|
|
||||||
|
|
||||||
Preamble
|
|
||||||
|
|
||||||
The GNU General Public License is a free, copyleft license for
|
|
||||||
software and other kinds of works.
|
|
||||||
|
|
||||||
The licenses for most software and other practical works are designed
|
|
||||||
to take away your freedom to share and change the works. By contrast,
|
|
||||||
the GNU General Public License is intended to guarantee your freedom to
|
|
||||||
share and change all versions of a program--to make sure it remains free
|
|
||||||
software for all its users. We, the Free Software Foundation, use the
|
|
||||||
GNU General Public License for most of our software; it applies also to
|
|
||||||
any other work released this way by its authors. You can apply it to
|
|
||||||
your programs, too.
|
|
||||||
|
|
||||||
When we speak of free software, we are referring to freedom, not
|
|
||||||
price. Our General Public Licenses are designed to make sure that you
|
|
||||||
have the freedom to distribute copies of free software (and charge for
|
|
||||||
them if you wish), that you receive source code or can get it if you
|
|
||||||
want it, that you can change the software or use pieces of it in new
|
|
||||||
free programs, and that you know you can do these things.
|
|
||||||
|
|
||||||
To protect your rights, we need to prevent others from denying you
|
|
||||||
these rights or asking you to surrender the rights. Therefore, you have
|
|
||||||
certain responsibilities if you distribute copies of the software, or if
|
|
||||||
you modify it: responsibilities to respect the freedom of others.
|
|
||||||
|
|
||||||
For example, if you distribute copies of such a program, whether
|
|
||||||
gratis or for a fee, you must pass on to the recipients the same
|
|
||||||
freedoms that you received. You must make sure that they, too, receive
|
|
||||||
or can get the source code. And you must show them these terms so they
|
|
||||||
know their rights.
|
|
||||||
|
|
||||||
Developers that use the GNU GPL protect your rights with two steps:
|
|
||||||
(1) assert copyright on the software, and (2) offer you this License
|
|
||||||
giving you legal permission to copy, distribute and/or modify it.
|
|
||||||
|
|
||||||
For the developers' and authors' protection, the GPL clearly explains
|
|
||||||
that there is no warranty for this free software. For both users' and
|
|
||||||
authors' sake, the GPL requires that modified versions be marked as
|
|
||||||
changed, so that their problems will not be attributed erroneously to
|
|
||||||
authors of previous versions.
|
|
||||||
|
|
||||||
Some devices are designed to deny users access to install or run
|
|
||||||
modified versions of the software inside them, although the manufacturer
|
|
||||||
can do so. This is fundamentally incompatible with the aim of
|
|
||||||
protecting users' freedom to change the software. The systematic
|
|
||||||
pattern of such abuse occurs in the area of products for individuals to
|
|
||||||
use, which is precisely where it is most unacceptable. Therefore, we
|
|
||||||
have designed this version of the GPL to prohibit the practice for those
|
|
||||||
products. If such problems arise substantially in other domains, we
|
|
||||||
stand ready to extend this provision to those domains in future versions
|
|
||||||
of the GPL, as needed to protect the freedom of users.
|
|
||||||
|
|
||||||
Finally, every program is threatened constantly by software patents.
|
|
||||||
States should not allow patents to restrict development and use of
|
|
||||||
software on general-purpose computers, but in those that do, we wish to
|
|
||||||
avoid the special danger that patents applied to a free program could
|
|
||||||
make it effectively proprietary. To prevent this, the GPL assures that
|
|
||||||
patents cannot be used to render the program non-free.
|
|
||||||
|
|
||||||
The precise terms and conditions for copying, distribution and
|
|
||||||
modification follow.
|
|
||||||
|
|
||||||
TERMS AND CONDITIONS
|
|
||||||
|
|
||||||
0. Definitions.
|
|
||||||
|
|
||||||
"This License" refers to version 3 of the GNU General Public License.
|
|
||||||
|
|
||||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
|
||||||
works, such as semiconductor masks.
|
|
||||||
|
|
||||||
"The Program" refers to any copyrightable work licensed under this
|
|
||||||
License. Each licensee is addressed as "you". "Licensees" and
|
|
||||||
"recipients" may be individuals or organizations.
|
|
||||||
|
|
||||||
To "modify" a work means to copy from or adapt all or part of the work
|
|
||||||
in a fashion requiring copyright permission, other than the making of an
|
|
||||||
exact copy. The resulting work is called a "modified version" of the
|
|
||||||
earlier work or a work "based on" the earlier work.
|
|
||||||
|
|
||||||
A "covered work" means either the unmodified Program or a work based
|
|
||||||
on the Program.
|
|
||||||
|
|
||||||
To "propagate" a work means to do anything with it that, without
|
|
||||||
permission, would make you directly or secondarily liable for
|
|
||||||
infringement under applicable copyright law, except executing it on a
|
|
||||||
computer or modifying a private copy. Propagation includes copying,
|
|
||||||
distribution (with or without modification), making available to the
|
|
||||||
public, and in some countries other activities as well.
|
|
||||||
|
|
||||||
To "convey" a work means any kind of propagation that enables other
|
|
||||||
parties to make or receive copies. Mere interaction with a user through
|
|
||||||
a computer network, with no transfer of a copy, is not conveying.
|
|
||||||
|
|
||||||
An interactive user interface displays "Appropriate Legal Notices"
|
|
||||||
to the extent that it includes a convenient and prominently visible
|
|
||||||
feature that (1) displays an appropriate copyright notice, and (2)
|
|
||||||
tells the user that there is no warranty for the work (except to the
|
|
||||||
extent that warranties are provided), that licensees may convey the
|
|
||||||
work under this License, and how to view a copy of this License. If
|
|
||||||
the interface presents a list of user commands or options, such as a
|
|
||||||
menu, a prominent item in the list meets this criterion.
|
|
||||||
|
|
||||||
1. Source Code.
|
|
||||||
|
|
||||||
The "source code" for a work means the preferred form of the work
|
|
||||||
for making modifications to it. "Object code" means any non-source
|
|
||||||
form of a work.
|
|
||||||
|
|
||||||
A "Standard Interface" means an interface that either is an official
|
|
||||||
standard defined by a recognized standards body, or, in the case of
|
|
||||||
interfaces specified for a particular programming language, one that
|
|
||||||
is widely used among developers working in that language.
|
|
||||||
|
|
||||||
The "System Libraries" of an executable work include anything, other
|
|
||||||
than the work as a whole, that (a) is included in the normal form of
|
|
||||||
packaging a Major Component, but which is not part of that Major
|
|
||||||
Component, and (b) serves only to enable use of the work with that
|
|
||||||
Major Component, or to implement a Standard Interface for which an
|
|
||||||
implementation is available to the public in source code form. A
|
|
||||||
"Major Component", in this context, means a major essential component
|
|
||||||
(kernel, window system, and so on) of the specific operating system
|
|
||||||
(if any) on which the executable work runs, or a compiler used to
|
|
||||||
produce the work, or an object code interpreter used to run it.
|
|
||||||
|
|
||||||
The "Corresponding Source" for a work in object code form means all
|
|
||||||
the source code needed to generate, install, and (for an executable
|
|
||||||
work) run the object code and to modify the work, including scripts to
|
|
||||||
control those activities. However, it does not include the work's
|
|
||||||
System Libraries, or general-purpose tools or generally available free
|
|
||||||
programs which are used unmodified in performing those activities but
|
|
||||||
which are not part of the work. For example, Corresponding Source
|
|
||||||
includes interface definition files associated with source files for
|
|
||||||
the work, and the source code for shared libraries and dynamically
|
|
||||||
linked subprograms that the work is specifically designed to require,
|
|
||||||
such as by intimate data communication or control flow between those
|
|
||||||
subprograms and other parts of the work.
|
|
||||||
|
|
||||||
The Corresponding Source need not include anything that users
|
|
||||||
can regenerate automatically from other parts of the Corresponding
|
|
||||||
Source.
|
|
||||||
|
|
||||||
The Corresponding Source for a work in source code form is that
|
|
||||||
same work.
|
|
||||||
|
|
||||||
2. Basic Permissions.
|
|
||||||
|
|
||||||
All rights granted under this License are granted for the term of
|
|
||||||
copyright on the Program, and are irrevocable provided the stated
|
|
||||||
conditions are met. This License explicitly affirms your unlimited
|
|
||||||
permission to run the unmodified Program. The output from running a
|
|
||||||
covered work is covered by this License only if the output, given its
|
|
||||||
content, constitutes a covered work. This License acknowledges your
|
|
||||||
rights of fair use or other equivalent, as provided by copyright law.
|
|
||||||
|
|
||||||
You may make, run and propagate covered works that you do not
|
|
||||||
convey, without conditions so long as your license otherwise remains
|
|
||||||
in force. You may convey covered works to others for the sole purpose
|
|
||||||
of having them make modifications exclusively for you, or provide you
|
|
||||||
with facilities for running those works, provided that you comply with
|
|
||||||
the terms of this License in conveying all material for which you do
|
|
||||||
not control copyright. Those thus making or running the covered works
|
|
||||||
for you must do so exclusively on your behalf, under your direction
|
|
||||||
and control, on terms that prohibit them from making any copies of
|
|
||||||
your copyrighted material outside their relationship with you.
|
|
||||||
|
|
||||||
Conveying under any other circumstances is permitted solely under
|
|
||||||
the conditions stated below. Sublicensing is not allowed; section 10
|
|
||||||
makes it unnecessary.
|
|
||||||
|
|
||||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
|
||||||
|
|
||||||
No covered work shall be deemed part of an effective technological
|
|
||||||
measure under any applicable law fulfilling obligations under article
|
|
||||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
|
||||||
similar laws prohibiting or restricting circumvention of such
|
|
||||||
measures.
|
|
||||||
|
|
||||||
When you convey a covered work, you waive any legal power to forbid
|
|
||||||
circumvention of technological measures to the extent such circumvention
|
|
||||||
is effected by exercising rights under this License with respect to
|
|
||||||
the covered work, and you disclaim any intention to limit operation or
|
|
||||||
modification of the work as a means of enforcing, against the work's
|
|
||||||
users, your or third parties' legal rights to forbid circumvention of
|
|
||||||
technological measures.
|
|
||||||
|
|
||||||
4. Conveying Verbatim Copies.
|
|
||||||
|
|
||||||
You may convey verbatim copies of the Program's source code as you
|
|
||||||
receive it, in any medium, provided that you conspicuously and
|
|
||||||
appropriately publish on each copy an appropriate copyright notice;
|
|
||||||
keep intact all notices stating that this License and any
|
|
||||||
non-permissive terms added in accord with section 7 apply to the code;
|
|
||||||
keep intact all notices of the absence of any warranty; and give all
|
|
||||||
recipients a copy of this License along with the Program.
|
|
||||||
|
|
||||||
You may charge any price or no price for each copy that you convey,
|
|
||||||
and you may offer support or warranty protection for a fee.
|
|
||||||
|
|
||||||
5. Conveying Modified Source Versions.
|
|
||||||
|
|
||||||
You may convey a work based on the Program, or the modifications to
|
|
||||||
produce it from the Program, in the form of source code under the
|
|
||||||
terms of section 4, provided that you also meet all of these conditions:
|
|
||||||
|
|
||||||
a) The work must carry prominent notices stating that you modified
|
|
||||||
it, and giving a relevant date.
|
|
||||||
|
|
||||||
b) The work must carry prominent notices stating that it is
|
|
||||||
released under this License and any conditions added under section
|
|
||||||
7. This requirement modifies the requirement in section 4 to
|
|
||||||
"keep intact all notices".
|
|
||||||
|
|
||||||
c) You must license the entire work, as a whole, under this
|
|
||||||
License to anyone who comes into possession of a copy. This
|
|
||||||
License will therefore apply, along with any applicable section 7
|
|
||||||
additional terms, to the whole of the work, and all its parts,
|
|
||||||
regardless of how they are packaged. This License gives no
|
|
||||||
permission to license the work in any other way, but it does not
|
|
||||||
invalidate such permission if you have separately received it.
|
|
||||||
|
|
||||||
d) If the work has interactive user interfaces, each must display
|
|
||||||
Appropriate Legal Notices; however, if the Program has interactive
|
|
||||||
interfaces that do not display Appropriate Legal Notices, your
|
|
||||||
work need not make them do so.
|
|
||||||
|
|
||||||
A compilation of a covered work with other separate and independent
|
|
||||||
works, which are not by their nature extensions of the covered work,
|
|
||||||
and which are not combined with it such as to form a larger program,
|
|
||||||
in or on a volume of a storage or distribution medium, is called an
|
|
||||||
"aggregate" if the compilation and its resulting copyright are not
|
|
||||||
used to limit the access or legal rights of the compilation's users
|
|
||||||
beyond what the individual works permit. Inclusion of a covered work
|
|
||||||
in an aggregate does not cause this License to apply to the other
|
|
||||||
parts of the aggregate.
|
|
||||||
|
|
||||||
6. Conveying Non-Source Forms.
|
|
||||||
|
|
||||||
You may convey a covered work in object code form under the terms
|
|
||||||
of sections 4 and 5, provided that you also convey the
|
|
||||||
machine-readable Corresponding Source under the terms of this License,
|
|
||||||
in one of these ways:
|
|
||||||
|
|
||||||
a) Convey the object code in, or embodied in, a physical product
|
|
||||||
(including a physical distribution medium), accompanied by the
|
|
||||||
Corresponding Source fixed on a durable physical medium
|
|
||||||
customarily used for software interchange.
|
|
||||||
|
|
||||||
b) Convey the object code in, or embodied in, a physical product
|
|
||||||
(including a physical distribution medium), accompanied by a
|
|
||||||
written offer, valid for at least three years and valid for as
|
|
||||||
long as you offer spare parts or customer support for that product
|
|
||||||
model, to give anyone who possesses the object code either (1) a
|
|
||||||
copy of the Corresponding Source for all the software in the
|
|
||||||
product that is covered by this License, on a durable physical
|
|
||||||
medium customarily used for software interchange, for a price no
|
|
||||||
more than your reasonable cost of physically performing this
|
|
||||||
conveying of source, or (2) access to copy the
|
|
||||||
Corresponding Source from a network server at no charge.
|
|
||||||
|
|
||||||
c) Convey individual copies of the object code with a copy of the
|
|
||||||
written offer to provide the Corresponding Source. This
|
|
||||||
alternative is allowed only occasionally and noncommercially, and
|
|
||||||
only if you received the object code with such an offer, in accord
|
|
||||||
with subsection 6b.
|
|
||||||
|
|
||||||
d) Convey the object code by offering access from a designated
|
|
||||||
place (gratis or for a charge), and offer equivalent access to the
|
|
||||||
Corresponding Source in the same way through the same place at no
|
|
||||||
further charge. You need not require recipients to copy the
|
|
||||||
Corresponding Source along with the object code. If the place to
|
|
||||||
copy the object code is a network server, the Corresponding Source
|
|
||||||
may be on a different server (operated by you or a third party)
|
|
||||||
that supports equivalent copying facilities, provided you maintain
|
|
||||||
clear directions next to the object code saying where to find the
|
|
||||||
Corresponding Source. Regardless of what server hosts the
|
|
||||||
Corresponding Source, you remain obligated to ensure that it is
|
|
||||||
available for as long as needed to satisfy these requirements.
|
|
||||||
|
|
||||||
e) Convey the object code using peer-to-peer transmission, provided
|
|
||||||
you inform other peers where the object code and Corresponding
|
|
||||||
Source of the work are being offered to the general public at no
|
|
||||||
charge under subsection 6d.
|
|
||||||
|
|
||||||
A separable portion of the object code, whose source code is excluded
|
|
||||||
from the Corresponding Source as a System Library, need not be
|
|
||||||
included in conveying the object code work.
|
|
||||||
|
|
||||||
A "User Product" is either (1) a "consumer product", which means any
|
|
||||||
tangible personal property which is normally used for personal, family,
|
|
||||||
or household purposes, or (2) anything designed or sold for incorporation
|
|
||||||
into a dwelling. In determining whether a product is a consumer product,
|
|
||||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
|
||||||
product received by a particular user, "normally used" refers to a
|
|
||||||
typical or common use of that class of product, regardless of the status
|
|
||||||
of the particular user or of the way in which the particular user
|
|
||||||
actually uses, or expects or is expected to use, the product. A product
|
|
||||||
is a consumer product regardless of whether the product has substantial
|
|
||||||
commercial, industrial or non-consumer uses, unless such uses represent
|
|
||||||
the only significant mode of use of the product.
|
|
||||||
|
|
||||||
"Installation Information" for a User Product means any methods,
|
|
||||||
procedures, authorization keys, or other information required to install
|
|
||||||
and execute modified versions of a covered work in that User Product from
|
|
||||||
a modified version of its Corresponding Source. The information must
|
|
||||||
suffice to ensure that the continued functioning of the modified object
|
|
||||||
code is in no case prevented or interfered with solely because
|
|
||||||
modification has been made.
|
|
||||||
|
|
||||||
If you convey an object code work under this section in, or with, or
|
|
||||||
specifically for use in, a User Product, and the conveying occurs as
|
|
||||||
part of a transaction in which the right of possession and use of the
|
|
||||||
User Product is transferred to the recipient in perpetuity or for a
|
|
||||||
fixed term (regardless of how the transaction is characterized), the
|
|
||||||
Corresponding Source conveyed under this section must be accompanied
|
|
||||||
by the Installation Information. But this requirement does not apply
|
|
||||||
if neither you nor any third party retains the ability to install
|
|
||||||
modified object code on the User Product (for example, the work has
|
|
||||||
been installed in ROM).
|
|
||||||
|
|
||||||
The requirement to provide Installation Information does not include a
|
|
||||||
requirement to continue to provide support service, warranty, or updates
|
|
||||||
for a work that has been modified or installed by the recipient, or for
|
|
||||||
the User Product in which it has been modified or installed. Access to a
|
|
||||||
network may be denied when the modification itself materially and
|
|
||||||
adversely affects the operation of the network or violates the rules and
|
|
||||||
protocols for communication across the network.
|
|
||||||
|
|
||||||
Corresponding Source conveyed, and Installation Information provided,
|
|
||||||
in accord with this section must be in a format that is publicly
|
|
||||||
documented (and with an implementation available to the public in
|
|
||||||
source code form), and must require no special password or key for
|
|
||||||
unpacking, reading or copying.
|
|
||||||
|
|
||||||
7. Additional Terms.
|
|
||||||
|
|
||||||
"Additional permissions" are terms that supplement the terms of this
|
|
||||||
License by making exceptions from one or more of its conditions.
|
|
||||||
Additional permissions that are applicable to the entire Program shall
|
|
||||||
be treated as though they were included in this License, to the extent
|
|
||||||
that they are valid under applicable law. If additional permissions
|
|
||||||
apply only to part of the Program, that part may be used separately
|
|
||||||
under those permissions, but the entire Program remains governed by
|
|
||||||
this License without regard to the additional permissions.
|
|
||||||
|
|
||||||
When you convey a copy of a covered work, you may at your option
|
|
||||||
remove any additional permissions from that copy, or from any part of
|
|
||||||
it. (Additional permissions may be written to require their own
|
|
||||||
removal in certain cases when you modify the work.) You may place
|
|
||||||
additional permissions on material, added by you to a covered work,
|
|
||||||
for which you have or can give appropriate copyright permission.
|
|
||||||
|
|
||||||
Notwithstanding any other provision of this License, for material you
|
|
||||||
add to a covered work, you may (if authorized by the copyright holders of
|
|
||||||
that material) supplement the terms of this License with terms:
|
|
||||||
|
|
||||||
a) Disclaiming warranty or limiting liability differently from the
|
|
||||||
terms of sections 15 and 16 of this License; or
|
|
||||||
|
|
||||||
b) Requiring preservation of specified reasonable legal notices or
|
|
||||||
author attributions in that material or in the Appropriate Legal
|
|
||||||
Notices displayed by works containing it; or
|
|
||||||
|
|
||||||
c) Prohibiting misrepresentation of the origin of that material, or
|
|
||||||
requiring that modified versions of such material be marked in
|
|
||||||
reasonable ways as different from the original version; or
|
|
||||||
|
|
||||||
d) Limiting the use for publicity purposes of names of licensors or
|
|
||||||
authors of the material; or
|
|
||||||
|
|
||||||
e) Declining to grant rights under trademark law for use of some
|
|
||||||
trade names, trademarks, or service marks; or
|
|
||||||
|
|
||||||
f) Requiring indemnification of licensors and authors of that
|
|
||||||
material by anyone who conveys the material (or modified versions of
|
|
||||||
it) with contractual assumptions of liability to the recipient, for
|
|
||||||
any liability that these contractual assumptions directly impose on
|
|
||||||
those licensors and authors.
|
|
||||||
|
|
||||||
All other non-permissive additional terms are considered "further
|
|
||||||
restrictions" within the meaning of section 10. If the Program as you
|
|
||||||
received it, or any part of it, contains a notice stating that it is
|
|
||||||
governed by this License along with a term that is a further
|
|
||||||
restriction, you may remove that term. If a license document contains
|
|
||||||
a further restriction but permits relicensing or conveying under this
|
|
||||||
License, you may add to a covered work material governed by the terms
|
|
||||||
of that license document, provided that the further restriction does
|
|
||||||
not survive such relicensing or conveying.
|
|
||||||
|
|
||||||
If you add terms to a covered work in accord with this section, you
|
|
||||||
must place, in the relevant source files, a statement of the
|
|
||||||
additional terms that apply to those files, or a notice indicating
|
|
||||||
where to find the applicable terms.
|
|
||||||
|
|
||||||
Additional terms, permissive or non-permissive, may be stated in the
|
|
||||||
form of a separately written license, or stated as exceptions;
|
|
||||||
the above requirements apply either way.
|
|
||||||
|
|
||||||
8. Termination.
|
|
||||||
|
|
||||||
You may not propagate or modify a covered work except as expressly
|
|
||||||
provided under this License. Any attempt otherwise to propagate or
|
|
||||||
modify it is void, and will automatically terminate your rights under
|
|
||||||
this License (including any patent licenses granted under the third
|
|
||||||
paragraph of section 11).
|
|
||||||
|
|
||||||
However, if you cease all violation of this License, then your
|
|
||||||
license from a particular copyright holder is reinstated (a)
|
|
||||||
provisionally, unless and until the copyright holder explicitly and
|
|
||||||
finally terminates your license, and (b) permanently, if the copyright
|
|
||||||
holder fails to notify you of the violation by some reasonable means
|
|
||||||
prior to 60 days after the cessation.
|
|
||||||
|
|
||||||
Moreover, your license from a particular copyright holder is
|
|
||||||
reinstated permanently if the copyright holder notifies you of the
|
|
||||||
violation by some reasonable means, this is the first time you have
|
|
||||||
received notice of violation of this License (for any work) from that
|
|
||||||
copyright holder, and you cure the violation prior to 30 days after
|
|
||||||
your receipt of the notice.
|
|
||||||
|
|
||||||
Termination of your rights under this section does not terminate the
|
|
||||||
licenses of parties who have received copies or rights from you under
|
|
||||||
this License. If your rights have been terminated and not permanently
|
|
||||||
reinstated, you do not qualify to receive new licenses for the same
|
|
||||||
material under section 10.
|
|
||||||
|
|
||||||
9. Acceptance Not Required for Having Copies.
|
|
||||||
|
|
||||||
You are not required to accept this License in order to receive or
|
|
||||||
run a copy of the Program. Ancillary propagation of a covered work
|
|
||||||
occurring solely as a consequence of using peer-to-peer transmission
|
|
||||||
to receive a copy likewise does not require acceptance. However,
|
|
||||||
nothing other than this License grants you permission to propagate or
|
|
||||||
modify any covered work. These actions infringe copyright if you do
|
|
||||||
not accept this License. Therefore, by modifying or propagating a
|
|
||||||
covered work, you indicate your acceptance of this License to do so.
|
|
||||||
|
|
||||||
10. Automatic Licensing of Downstream Recipients.
|
|
||||||
|
|
||||||
Each time you convey a covered work, the recipient automatically
|
|
||||||
receives a license from the original licensors, to run, modify and
|
|
||||||
propagate that work, subject to this License. You are not responsible
|
|
||||||
for enforcing compliance by third parties with this License.
|
|
||||||
|
|
||||||
An "entity transaction" is a transaction transferring control of an
|
|
||||||
organization, or substantially all assets of one, or subdividing an
|
|
||||||
organization, or merging organizations. If propagation of a covered
|
|
||||||
work results from an entity transaction, each party to that
|
|
||||||
transaction who receives a copy of the work also receives whatever
|
|
||||||
licenses to the work the party's predecessor in interest had or could
|
|
||||||
give under the previous paragraph, plus a right to possession of the
|
|
||||||
Corresponding Source of the work from the predecessor in interest, if
|
|
||||||
the predecessor has it or can get it with reasonable efforts.
|
|
||||||
|
|
||||||
You may not impose any further restrictions on the exercise of the
|
|
||||||
rights granted or affirmed under this License. For example, you may
|
|
||||||
not impose a license fee, royalty, or other charge for exercise of
|
|
||||||
rights granted under this License, and you may not initiate litigation
|
|
||||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
|
||||||
any patent claim is infringed by making, using, selling, offering for
|
|
||||||
sale, or importing the Program or any portion of it.
|
|
||||||
|
|
||||||
11. Patents.
|
|
||||||
|
|
||||||
A "contributor" is a copyright holder who authorizes use under this
|
|
||||||
License of the Program or a work on which the Program is based. The
|
|
||||||
work thus licensed is called the contributor's "contributor version".
|
|
||||||
|
|
||||||
A contributor's "essential patent claims" are all patent claims
|
|
||||||
owned or controlled by the contributor, whether already acquired or
|
|
||||||
hereafter acquired, that would be infringed by some manner, permitted
|
|
||||||
by this License, of making, using, or selling its contributor version,
|
|
||||||
but do not include claims that would be infringed only as a
|
|
||||||
consequence of further modification of the contributor version. For
|
|
||||||
purposes of this definition, "control" includes the right to grant
|
|
||||||
patent sublicenses in a manner consistent with the requirements of
|
|
||||||
this License.
|
|
||||||
|
|
||||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
|
||||||
patent license under the contributor's essential patent claims, to
|
|
||||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
|
||||||
propagate the contents of its contributor version.
|
|
||||||
|
|
||||||
In the following three paragraphs, a "patent license" is any express
|
|
||||||
agreement or commitment, however denominated, not to enforce a patent
|
|
||||||
(such as an express permission to practice a patent or covenant not to
|
|
||||||
sue for patent infringement). To "grant" such a patent license to a
|
|
||||||
party means to make such an agreement or commitment not to enforce a
|
|
||||||
patent against the party.
|
|
||||||
|
|
||||||
If you convey a covered work, knowingly relying on a patent license,
|
|
||||||
and the Corresponding Source of the work is not available for anyone
|
|
||||||
to copy, free of charge and under the terms of this License, through a
|
|
||||||
publicly available network server or other readily accessible means,
|
|
||||||
then you must either (1) cause the Corresponding Source to be so
|
|
||||||
available, or (2) arrange to deprive yourself of the benefit of the
|
|
||||||
patent license for this particular work, or (3) arrange, in a manner
|
|
||||||
consistent with the requirements of this License, to extend the patent
|
|
||||||
license to downstream recipients. "Knowingly relying" means you have
|
|
||||||
actual knowledge that, but for the patent license, your conveying the
|
|
||||||
covered work in a country, or your recipient's use of the covered work
|
|
||||||
in a country, would infringe one or more identifiable patents in that
|
|
||||||
country that you have reason to believe are valid.
|
|
||||||
|
|
||||||
If, pursuant to or in connection with a single transaction or
|
|
||||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
|
||||||
covered work, and grant a patent license to some of the parties
|
|
||||||
receiving the covered work authorizing them to use, propagate, modify
|
|
||||||
or convey a specific copy of the covered work, then the patent license
|
|
||||||
you grant is automatically extended to all recipients of the covered
|
|
||||||
work and works based on it.
|
|
||||||
|
|
||||||
A patent license is "discriminatory" if it does not include within
|
|
||||||
the scope of its coverage, prohibits the exercise of, or is
|
|
||||||
conditioned on the non-exercise of one or more of the rights that are
|
|
||||||
specifically granted under this License. You may not convey a covered
|
|
||||||
work if you are a party to an arrangement with a third party that is
|
|
||||||
in the business of distributing software, under which you make payment
|
|
||||||
to the third party based on the extent of your activity of conveying
|
|
||||||
the work, and under which the third party grants, to any of the
|
|
||||||
parties who would receive the covered work from you, a discriminatory
|
|
||||||
patent license (a) in connection with copies of the covered work
|
|
||||||
conveyed by you (or copies made from those copies), or (b) primarily
|
|
||||||
for and in connection with specific products or compilations that
|
|
||||||
contain the covered work, unless you entered into that arrangement,
|
|
||||||
or that patent license was granted, prior to 28 March 2007.
|
|
||||||
|
|
||||||
Nothing in this License shall be construed as excluding or limiting
|
|
||||||
any implied license or other defenses to infringement that may
|
|
||||||
otherwise be available to you under applicable patent law.
|
|
||||||
|
|
||||||
12. No Surrender of Others' Freedom.
|
|
||||||
|
|
||||||
If conditions are imposed on you (whether by court order, agreement or
|
|
||||||
otherwise) that contradict the conditions of this License, they do not
|
|
||||||
excuse you from the conditions of this License. If you cannot convey a
|
|
||||||
covered work so as to satisfy simultaneously your obligations under this
|
|
||||||
License and any other pertinent obligations, then as a consequence you may
|
|
||||||
not convey it at all. For example, if you agree to terms that obligate you
|
|
||||||
to collect a royalty for further conveying from those to whom you convey
|
|
||||||
the Program, the only way you could satisfy both those terms and this
|
|
||||||
License would be to refrain entirely from conveying the Program.
|
|
||||||
|
|
||||||
13. Use with the GNU Affero General Public License.
|
|
||||||
|
|
||||||
Notwithstanding any other provision of this License, you have
|
|
||||||
permission to link or combine any covered work with a work licensed
|
|
||||||
under version 3 of the GNU Affero General Public License into a single
|
|
||||||
combined work, and to convey the resulting work. The terms of this
|
|
||||||
License will continue to apply to the part which is the covered work,
|
|
||||||
but the special requirements of the GNU Affero General Public License,
|
|
||||||
section 13, concerning interaction through a network will apply to the
|
|
||||||
combination as such.
|
|
||||||
|
|
||||||
14. Revised Versions of this License.
|
|
||||||
|
|
||||||
The Free Software Foundation may publish revised and/or new versions of
|
|
||||||
the GNU General Public License from time to time. Such new versions will
|
|
||||||
be similar in spirit to the present version, but may differ in detail to
|
|
||||||
address new problems or concerns.
|
|
||||||
|
|
||||||
Each version is given a distinguishing version number. If the
|
|
||||||
Program specifies that a certain numbered version of the GNU General
|
|
||||||
Public License "or any later version" applies to it, you have the
|
|
||||||
option of following the terms and conditions either of that numbered
|
|
||||||
version or of any later version published by the Free Software
|
|
||||||
Foundation. If the Program does not specify a version number of the
|
|
||||||
GNU General Public License, you may choose any version ever published
|
|
||||||
by the Free Software Foundation.
|
|
||||||
|
|
||||||
If the Program specifies that a proxy can decide which future
|
|
||||||
versions of the GNU General Public License can be used, that proxy's
|
|
||||||
public statement of acceptance of a version permanently authorizes you
|
|
||||||
to choose that version for the Program.
|
|
||||||
|
|
||||||
Later license versions may give you additional or different
|
|
||||||
permissions. However, no additional obligations are imposed on any
|
|
||||||
author or copyright holder as a result of your choosing to follow a
|
|
||||||
later version.
|
|
||||||
|
|
||||||
15. Disclaimer of Warranty.
|
|
||||||
|
|
||||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
|
||||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
|
||||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
|
||||||
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
||||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
|
||||||
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
|
||||||
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
|
||||||
|
|
||||||
16. Limitation of Liability.
|
|
||||||
|
|
||||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
|
||||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
|
||||||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
|
||||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
|
||||||
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
|
||||||
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
|
||||||
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
|
||||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
|
||||||
SUCH DAMAGES.
|
|
||||||
|
|
||||||
17. Interpretation of Sections 15 and 16.
|
|
||||||
|
|
||||||
If the disclaimer of warranty and limitation of liability provided
|
|
||||||
above cannot be given local legal effect according to their terms,
|
|
||||||
reviewing courts shall apply local law that most closely approximates
|
|
||||||
an absolute waiver of all civil liability in connection with the
|
|
||||||
Program, unless a warranty or assumption of liability accompanies a
|
|
||||||
copy of the Program in return for a fee.
|
|
||||||
|
|
||||||
END OF TERMS AND CONDITIONS
|
|
||||||
|
|
||||||
How to Apply These Terms to Your New Programs
|
|
||||||
|
|
||||||
If you develop a new program, and you want it to be of the greatest
|
|
||||||
possible use to the public, the best way to achieve this is to make it
|
|
||||||
free software which everyone can redistribute and change under these terms.
|
|
||||||
|
|
||||||
To do so, attach the following notices to the program. It is safest
|
|
||||||
to attach them to the start of each source file to most effectively
|
|
||||||
state the exclusion of warranty; and each file should have at least
|
|
||||||
the "copyright" line and a pointer to where the full notice is found.
|
|
||||||
|
|
||||||
<one line to give the program's name and a brief idea of what it does.>
|
|
||||||
Copyright (C) <year> <name of author>
|
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
Also add information on how to contact you by electronic and paper mail.
|
|
||||||
|
|
||||||
If the program does terminal interaction, make it output a short
|
|
||||||
notice like this when it starts in an interactive mode:
|
|
||||||
|
|
||||||
<program> Copyright (C) <year> <name of author>
|
|
||||||
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
|
||||||
This is free software, and you are welcome to redistribute it
|
|
||||||
under certain conditions; type `show c' for details.
|
|
||||||
|
|
||||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
|
||||||
parts of the General Public License. Of course, your program's commands
|
|
||||||
might be different; for a GUI interface, you would use an "about box".
|
|
||||||
|
|
||||||
You should also get your employer (if you work as a programmer) or school,
|
|
||||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
|
||||||
For more information on this, and how to apply and follow the GNU GPL, see
|
|
||||||
<https://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
The GNU General Public License does not permit incorporating your program
|
|
||||||
into proprietary programs. If your program is a subroutine library, you
|
|
||||||
may consider it more useful to permit linking proprietary applications with
|
|
||||||
the library. If this is what you want to do, use the GNU Lesser General
|
|
||||||
Public License instead of this License. But first, please read
|
|
||||||
<https://www.gnu.org/licenses/why-not-lgpl.html>.
|
|
||||||
103
README.md
|
|
@ -1,103 +0,0 @@
|
||||||
# <img src="https://raw.githubusercontent.com/schmelczer/great-ai/main/docs/media/logo.png" alt="logo of great-ai" width=60 /> GreatAI
|
|
||||||
|
|
||||||
> Easily transform your prototype AI code into production-ready software.
|
|
||||||
|
|
||||||
[](https://badge.fury.io/py/great-ai)
|
|
||||||
[](https://pepy.tech/project/great-ai)
|
|
||||||
[](https://hub.docker.com/repository/docker/schmelczera/great-ai)
|
|
||||||
[](https://github.com/schmelczer/great-ai/actions/workflows/test.yml)
|
|
||||||
[](https://sonar.scoutinscience.com/dashboard?id=great-ai)
|
|
||||||
[](https://sonar.scoutinscience.com/dashboard?id=great-ai)
|
|
||||||
|
|
||||||
Applying AI is becoming increasingly more accessible, but many case studies have shown that these applications are often deployed poorly. This may lead to suboptimal performance and to introducing unintended biases. GreatAI helps fix this by allowing you to easily transform your prototype AI code into production-ready software.
|
|
||||||
|
|
||||||
## Example
|
|
||||||
|
|
||||||
```sh
|
|
||||||
pip install great-ai
|
|
||||||
```
|
|
||||||
|
|
||||||
Create a new file called `demo.py`
|
|
||||||
|
|
||||||
```python
|
|
||||||
from great_ai import GreatAI
|
|
||||||
|
|
||||||
@GreatAI.create
|
|
||||||
def greeter(name: str) -> str:
|
|
||||||
return f"Hello {name}!"
|
|
||||||
```
|
|
||||||
|
|
||||||
Start it by executing `great-ai demo.py`, and find the dashboard at [http://localhost:6060](http://localhost:6060/dashboard).
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
That's it. Your GreatAI service is _nearly_ ready for production use. Many of the [SE4ML best practices](https://se-ml.github.io) are configured and implemented automatically (of course, these can be customised as well).
|
|
||||||
|
|
||||||
[Check out the full documentation here](https://great-ai.scoutinscience.com).
|
|
||||||
|
|
||||||
## Why is this GREAT?
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
GreatAI fits between the prototype and deployment phases of your AI development lifecycle. This is highlighted in blue in the diagram. Here, several best practices can be automatically implemented, aiming to achieve the following attributes:
|
|
||||||
|
|
||||||
- **G**eneral: use any Python library without restriction
|
|
||||||
- **R**obust: have error-handling and well-tested utilities out-of-the-box
|
|
||||||
- **E**nd-to-end: utilise end-to-end feedback as a built-in, first-class concept
|
|
||||||
- **A**utomated: focus only on what actually requires your attention
|
|
||||||
- **T**rustworthy: deploy models that you and society can confidently trust
|
|
||||||
|
|
||||||
## Why GreatAI?
|
|
||||||
|
|
||||||
There are other existing solutions aiming to facilitate this phase. [Amazon SageMaker](https://aws.amazon.com/sagemaker) and [Seldon Core](https://www.seldon.io/solutions/open-source-projects/core) provide the most comprehensive suite of features. If you have the opportunity to use them, do that because they're great.
|
|
||||||
|
|
||||||
However, [research indicates](https://great-ai.scoutinscience.com) that professionals rarely use them. This may be due to their inherent setup and operational complexity. **GreatAI is designed to be as simple to use as possible.** Its straightforward, high-level API and sensible default configuration make it easy to start using. Despite its relative simplicity over Seldon Core, it still implements many of the [SE4ML best practices](https://se-ml.github.io), and thus, can meaningfully improve your deployment without requiring prohibitively great effort.
|
|
||||||
|
|
||||||
## [Learn more](https://great-ai.scoutinscience.com)
|
|
||||||
|
|
||||||
[Check out the full documentation here](https://great-ai.scoutinscience.com).
|
|
||||||
|
|
||||||
## Find `great-ai` on [PyPI](https://pypi.org/project/great-ai/)
|
|
||||||
|
|
||||||
```sh
|
|
||||||
pip install great-ai
|
|
||||||
```
|
|
||||||
|
|
||||||
## Find `great-ai` on [DockerHub](https://hub.docker.com/repository/docker/schmelczera/great-ai)
|
|
||||||
|
|
||||||
```sh
|
|
||||||
docker run -p6060:6060 schmelczera/great-ai
|
|
||||||
```
|
|
||||||
|
|
||||||
## Contribute
|
|
||||||
|
|
||||||
Contributions are welcome.
|
|
||||||
|
|
||||||
### Install for development
|
|
||||||
|
|
||||||
```sh
|
|
||||||
python3 -m venv --copies .env
|
|
||||||
source .env/bin/activate
|
|
||||||
pip install --upgrade flit pip
|
|
||||||
flit install --symlink
|
|
||||||
```
|
|
||||||
|
|
||||||
### Develop
|
|
||||||
|
|
||||||
```sh
|
|
||||||
scripts/format-python.sh great_ai docs tests
|
|
||||||
```
|
|
||||||
|
|
||||||
> Format code.
|
|
||||||
|
|
||||||
```sh
|
|
||||||
python3 -m pytest --doctest-modules --asyncio-mode=strict .
|
|
||||||
```
|
|
||||||
|
|
||||||
> Run tests.
|
|
||||||
|
|
||||||
```sh
|
|
||||||
mkdocs serve
|
|
||||||
```
|
|
||||||
|
|
||||||
> Serve documentation.
|
|
||||||
36
assets/_mkdocstrings.css
Normal file
|
|
@ -0,0 +1,36 @@
|
||||||
|
|
||||||
|
/* Don't capitalize names. */
|
||||||
|
h5.doc-heading {
|
||||||
|
text-transform: none !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Avoid breaking parameters name, etc. in table cells. */
|
||||||
|
.doc-contents td code {
|
||||||
|
word-break: normal !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* For pieces of Markdown rendered in table cells. */
|
||||||
|
.doc-contents td p {
|
||||||
|
margin-top: 0 !important;
|
||||||
|
margin-bottom: 0 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Max width for docstring sections tables. */
|
||||||
|
.doc .md-typeset__table,
|
||||||
|
.doc .md-typeset__table table {
|
||||||
|
display: table !important;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
.doc .md-typeset__table tr {
|
||||||
|
display: table-row;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Avoid line breaks in rendered fields. */
|
||||||
|
.field-body p {
|
||||||
|
display: inline;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Defaults in Spacy table style. */
|
||||||
|
.doc-param-default {
|
||||||
|
float: right;
|
||||||
|
}
|
||||||
BIN
assets/images/favicon.png
Normal file
|
After Width: | Height: | Size: 1.8 KiB |
29
assets/javascripts/bundle.d6c3db9e.min.js
vendored
Normal file
8
assets/javascripts/bundle.d6c3db9e.min.js.map
Normal file
1
assets/javascripts/lunr/min/lunr.ar.min.js
vendored
Normal file
18
assets/javascripts/lunr/min/lunr.da.min.js
vendored
Normal file
|
|
@ -0,0 +1,18 @@
|
||||||
|
/*!
|
||||||
|
* Lunr languages, `Danish` language
|
||||||
|
* https://github.com/MihaiValentin/lunr-languages
|
||||||
|
*
|
||||||
|
* Copyright 2014, Mihai Valentin
|
||||||
|
* http://www.mozilla.org/MPL/
|
||||||
|
*/
|
||||||
|
/*!
|
||||||
|
* based on
|
||||||
|
* Snowball JavaScript Library v0.3
|
||||||
|
* http://code.google.com/p/urim/
|
||||||
|
* http://snowball.tartarus.org/
|
||||||
|
*
|
||||||
|
* Copyright 2010, Oleg Mazko
|
||||||
|
* http://www.mozilla.org/MPL/
|
||||||
|
*/
|
||||||
|
|
||||||
|
!function(e,r){"function"==typeof define&&define.amd?define(r):"object"==typeof exports?module.exports=r():r()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");e.da=function(){this.pipeline.reset(),this.pipeline.add(e.da.trimmer,e.da.stopWordFilter,e.da.stemmer),this.searchPipeline&&(this.searchPipeline.reset(),this.searchPipeline.add(e.da.stemmer))},e.da.wordCharacters="A-Za-zªºÀ-ÖØ-öø-ʸˠ-ˤᴀ-ᴥᴬ-ᵜᵢ-ᵥᵫ-ᵷᵹ-ᶾḀ-ỿⁱⁿₐ-ₜKÅℲⅎⅠ-ↈⱠ-ⱿꜢ-ꞇꞋ-ꞭꞰ-ꞷꟷ-ꟿꬰ-ꭚꭜ-ꭤff-stA-Za-z",e.da.trimmer=e.trimmerSupport.generateTrimmer(e.da.wordCharacters),e.Pipeline.registerFunction(e.da.trimmer,"trimmer-da"),e.da.stemmer=function(){var r=e.stemmerSupport.Among,i=e.stemmerSupport.SnowballProgram,n=new function(){function e(){var e,r=f.cursor+3;if(d=f.limit,0<=r&&r<=f.limit){for(a=r;;){if(e=f.cursor,f.in_grouping(w,97,248)){f.cursor=e;break}if(f.cursor=e,e>=f.limit)return;f.cursor++}for(;!f.out_grouping(w,97,248);){if(f.cursor>=f.limit)return;f.cursor++}d=f.cursor,d<a&&(d=a)}}function n(){var e,r;if(f.cursor>=d&&(r=f.limit_backward,f.limit_backward=d,f.ket=f.cursor,e=f.find_among_b(c,32),f.limit_backward=r,e))switch(f.bra=f.cursor,e){case 1:f.slice_del();break;case 2:f.in_grouping_b(p,97,229)&&f.slice_del()}}function t(){var e,r=f.limit-f.cursor;f.cursor>=d&&(e=f.limit_backward,f.limit_backward=d,f.ket=f.cursor,f.find_among_b(l,4)?(f.bra=f.cursor,f.limit_backward=e,f.cursor=f.limit-r,f.cursor>f.limit_backward&&(f.cursor--,f.bra=f.cursor,f.slice_del())):f.limit_backward=e)}function s(){var e,r,i,n=f.limit-f.cursor;if(f.ket=f.cursor,f.eq_s_b(2,"st")&&(f.bra=f.cursor,f.eq_s_b(2,"ig")&&f.slice_del()),f.cursor=f.limit-n,f.cursor>=d&&(r=f.limit_backward,f.limit_backward=d,f.ket=f.cursor,e=f.find_among_b(m,5),f.limit_backward=r,e))switch(f.bra=f.cursor,e){case 1:f.slice_del(),i=f.limit-f.cursor,t(),f.cursor=f.limit-i;break;case 2:f.slice_from("løs")}}function o(){var e;f.cursor>=d&&(e=f.limit_backward,f.limit_backward=d,f.ket=f.cursor,f.out_grouping_b(w,97,248)?(f.bra=f.cursor,u=f.slice_to(u),f.limit_backward=e,f.eq_v_b(u)&&f.slice_del()):f.limit_backward=e)}var a,d,u,c=[new r("hed",-1,1),new r("ethed",0,1),new r("ered",-1,1),new r("e",-1,1),new r("erede",3,1),new r("ende",3,1),new r("erende",5,1),new r("ene",3,1),new r("erne",3,1),new r("ere",3,1),new r("en",-1,1),new r("heden",10,1),new r("eren",10,1),new r("er",-1,1),new r("heder",13,1),new r("erer",13,1),new r("s",-1,2),new r("heds",16,1),new r("es",16,1),new r("endes",18,1),new r("erendes",19,1),new r("enes",18,1),new r("ernes",18,1),new r("eres",18,1),new r("ens",16,1),new r("hedens",24,1),new r("erens",24,1),new r("ers",16,1),new r("ets",16,1),new r("erets",28,1),new r("et",-1,1),new r("eret",30,1)],l=[new r("gd",-1,-1),new r("dt",-1,-1),new r("gt",-1,-1),new r("kt",-1,-1)],m=[new r("ig",-1,1),new r("lig",0,1),new r("elig",1,1),new r("els",-1,1),new r("løst",-1,2)],w=[17,65,16,1,0,0,0,0,0,0,0,0,0,0,0,0,48,0,128],p=[239,254,42,3,0,0,0,0,0,0,0,0,0,0,0,0,16],f=new i;this.setCurrent=function(e){f.setCurrent(e)},this.getCurrent=function(){return f.getCurrent()},this.stem=function(){var r=f.cursor;return e(),f.limit_backward=r,f.cursor=f.limit,n(),f.cursor=f.limit,t(),f.cursor=f.limit,s(),f.cursor=f.limit,o(),!0}};return function(e){return"function"==typeof e.update?e.update(function(e){return n.setCurrent(e),n.stem(),n.getCurrent()}):(n.setCurrent(e),n.stem(),n.getCurrent())}}(),e.Pipeline.registerFunction(e.da.stemmer,"stemmer-da"),e.da.stopWordFilter=e.generateStopWordFilter("ad af alle alt anden at blev blive bliver da de dem den denne der deres det dette dig din disse dog du efter eller en end er et for fra ham han hans har havde have hende hendes her hos hun hvad hvis hvor i ikke ind jeg jer jo kunne man mange med meget men mig min mine mit mod ned noget nogle nu når og også om op os over på selv sig sin sine sit skal skulle som sådan thi til ud under var vi vil ville vor være været".split(" ")),e.Pipeline.registerFunction(e.da.stopWordFilter,"stopWordFilter-da")}});
|
||||||
18
assets/javascripts/lunr/min/lunr.de.min.js
vendored
Normal file
18
assets/javascripts/lunr/min/lunr.du.min.js
vendored
Normal file
18
assets/javascripts/lunr/min/lunr.es.min.js
vendored
Normal file
18
assets/javascripts/lunr/min/lunr.fi.min.js
vendored
Normal file
18
assets/javascripts/lunr/min/lunr.fr.min.js
vendored
Normal file
1
assets/javascripts/lunr/min/lunr.hi.min.js
vendored
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
!function(e,r){"function"==typeof define&&define.amd?define(r):"object"==typeof exports?module.exports=r():r()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");e.hi=function(){this.pipeline.reset(),this.pipeline.add(e.hi.trimmer,e.hi.stopWordFilter,e.hi.stemmer),this.searchPipeline&&(this.searchPipeline.reset(),this.searchPipeline.add(e.hi.stemmer))},e.hi.wordCharacters="ऀ-ःऄ-एऐ-टठ-यर-िी-ॏॐ-य़ॠ-९॰-ॿa-zA-Za-zA-Z0-90-9",e.hi.trimmer=e.trimmerSupport.generateTrimmer(e.hi.wordCharacters),e.Pipeline.registerFunction(e.hi.trimmer,"trimmer-hi"),e.hi.stopWordFilter=e.generateStopWordFilter("अत अपना अपनी अपने अभी अंदर आदि आप इत्यादि इन इनका इन्हीं इन्हें इन्हों इस इसका इसकी इसके इसमें इसी इसे उन उनका उनकी उनके उनको उन्हीं उन्हें उन्हों उस उसके उसी उसे एक एवं एस ऐसे और कई कर करता करते करना करने करें कहते कहा का काफ़ी कि कितना किन्हें किन्हों किया किर किस किसी किसे की कुछ कुल के को कोई कौन कौनसा गया घर जब जहाँ जा जितना जिन जिन्हें जिन्हों जिस जिसे जीधर जैसा जैसे जो तक तब तरह तिन तिन्हें तिन्हों तिस तिसे तो था थी थे दबारा दिया दुसरा दूसरे दो द्वारा न नके नहीं ना निहायत नीचे ने पर पहले पूरा पे फिर बनी बही बहुत बाद बाला बिलकुल भी भीतर मगर मानो मे में यदि यह यहाँ यही या यिह ये रखें रहा रहे ऱ्वासा लिए लिये लेकिन व वग़ैरह वर्ग वह वहाँ वहीं वाले वुह वे वो सकता सकते सबसे सभी साथ साबुत साभ सारा से सो संग ही हुआ हुई हुए है हैं हो होता होती होते होना होने".split(" ")),e.hi.stemmer=function(){return function(e){return"function"==typeof e.update?e.update(function(e){return e}):e}}();var r=e.wordcut;r.init(),e.hi.tokenizer=function(i){if(!arguments.length||null==i||void 0==i)return[];if(Array.isArray(i))return i.map(function(r){return isLunr2?new e.Token(r.toLowerCase()):r.toLowerCase()});var t=i.toString().toLowerCase().replace(/^\s+/,"");return r.cut(t).split("|")},e.Pipeline.registerFunction(e.hi.stemmer,"stemmer-hi"),e.Pipeline.registerFunction(e.hi.stopWordFilter,"stopWordFilter-hi")}});
|
||||||
18
assets/javascripts/lunr/min/lunr.hu.min.js
vendored
Normal file
18
assets/javascripts/lunr/min/lunr.it.min.js
vendored
Normal file
1
assets/javascripts/lunr/min/lunr.ja.min.js
vendored
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
!function(e,r){"function"==typeof define&&define.amd?define(r):"object"==typeof exports?module.exports=r():r()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");var r="2"==e.version[0];e.ja=function(){this.pipeline.reset(),this.pipeline.add(e.ja.trimmer,e.ja.stopWordFilter,e.ja.stemmer),r?this.tokenizer=e.ja.tokenizer:(e.tokenizer&&(e.tokenizer=e.ja.tokenizer),this.tokenizerFn&&(this.tokenizerFn=e.ja.tokenizer))};var t=new e.TinySegmenter;e.ja.tokenizer=function(i){var n,o,s,p,a,u,m,l,c,f;if(!arguments.length||null==i||void 0==i)return[];if(Array.isArray(i))return i.map(function(t){return r?new e.Token(t.toLowerCase()):t.toLowerCase()});for(o=i.toString().toLowerCase().replace(/^\s+/,""),n=o.length-1;n>=0;n--)if(/\S/.test(o.charAt(n))){o=o.substring(0,n+1);break}for(a=[],s=o.length,c=0,l=0;c<=s;c++)if(u=o.charAt(c),m=c-l,u.match(/\s/)||c==s){if(m>0)for(p=t.segment(o.slice(l,c)).filter(function(e){return!!e}),f=l,n=0;n<p.length;n++)r?a.push(new e.Token(p[n],{position:[f,p[n].length],index:a.length})):a.push(p[n]),f+=p[n].length;l=c+1}return a},e.ja.stemmer=function(){return function(e){return e}}(),e.Pipeline.registerFunction(e.ja.stemmer,"stemmer-ja"),e.ja.wordCharacters="一二三四五六七八九十百千万億兆一-龠々〆ヵヶぁ-んァ-ヴーア-ン゙a-zA-Za-zA-Z0-90-9",e.ja.trimmer=e.trimmerSupport.generateTrimmer(e.ja.wordCharacters),e.Pipeline.registerFunction(e.ja.trimmer,"trimmer-ja"),e.ja.stopWordFilter=e.generateStopWordFilter("これ それ あれ この その あの ここ そこ あそこ こちら どこ だれ なに なん 何 私 貴方 貴方方 我々 私達 あの人 あのかた 彼女 彼 です あります おります います は が の に を で え から まで より も どの と し それで しかし".split(" ")),e.Pipeline.registerFunction(e.ja.stopWordFilter,"stopWordFilter-ja"),e.jp=e.ja,e.Pipeline.registerFunction(e.jp.stemmer,"stemmer-jp"),e.Pipeline.registerFunction(e.jp.trimmer,"trimmer-jp"),e.Pipeline.registerFunction(e.jp.stopWordFilter,"stopWordFilter-jp")}});
|
||||||
1
assets/javascripts/lunr/min/lunr.jp.min.js
vendored
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
module.exports=require("./lunr.ja");
|
||||||
1
assets/javascripts/lunr/min/lunr.ko.min.js
vendored
Normal file
1
assets/javascripts/lunr/min/lunr.multi.min.js
vendored
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
!function(e,t){"function"==typeof define&&define.amd?define(t):"object"==typeof exports?module.exports=t():t()(e.lunr)}(this,function(){return function(e){e.multiLanguage=function(){for(var t=Array.prototype.slice.call(arguments),i=t.join("-"),r="",n=[],s=[],p=0;p<t.length;++p)"en"==t[p]?(r+="\\w",n.unshift(e.stopWordFilter),n.push(e.stemmer),s.push(e.stemmer)):(r+=e[t[p]].wordCharacters,e[t[p]].stopWordFilter&&n.unshift(e[t[p]].stopWordFilter),e[t[p]].stemmer&&(n.push(e[t[p]].stemmer),s.push(e[t[p]].stemmer)));var o=e.trimmerSupport.generateTrimmer(r);return e.Pipeline.registerFunction(o,"lunr-multi-trimmer-"+i),n.unshift(o),function(){this.pipeline.reset(),this.pipeline.add.apply(this.pipeline,n),this.searchPipeline&&(this.searchPipeline.reset(),this.searchPipeline.add.apply(this.searchPipeline,s))}}}});
|
||||||
18
assets/javascripts/lunr/min/lunr.nl.min.js
vendored
Normal file
18
assets/javascripts/lunr/min/lunr.no.min.js
vendored
Normal file
|
|
@ -0,0 +1,18 @@
|
||||||
|
/*!
|
||||||
|
* Lunr languages, `Norwegian` language
|
||||||
|
* https://github.com/MihaiValentin/lunr-languages
|
||||||
|
*
|
||||||
|
* Copyright 2014, Mihai Valentin
|
||||||
|
* http://www.mozilla.org/MPL/
|
||||||
|
*/
|
||||||
|
/*!
|
||||||
|
* based on
|
||||||
|
* Snowball JavaScript Library v0.3
|
||||||
|
* http://code.google.com/p/urim/
|
||||||
|
* http://snowball.tartarus.org/
|
||||||
|
*
|
||||||
|
* Copyright 2010, Oleg Mazko
|
||||||
|
* http://www.mozilla.org/MPL/
|
||||||
|
*/
|
||||||
|
|
||||||
|
!function(e,r){"function"==typeof define&&define.amd?define(r):"object"==typeof exports?module.exports=r():r()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");e.no=function(){this.pipeline.reset(),this.pipeline.add(e.no.trimmer,e.no.stopWordFilter,e.no.stemmer),this.searchPipeline&&(this.searchPipeline.reset(),this.searchPipeline.add(e.no.stemmer))},e.no.wordCharacters="A-Za-zªºÀ-ÖØ-öø-ʸˠ-ˤᴀ-ᴥᴬ-ᵜᵢ-ᵥᵫ-ᵷᵹ-ᶾḀ-ỿⁱⁿₐ-ₜKÅℲⅎⅠ-ↈⱠ-ⱿꜢ-ꞇꞋ-ꞭꞰ-ꞷꟷ-ꟿꬰ-ꭚꭜ-ꭤff-stA-Za-z",e.no.trimmer=e.trimmerSupport.generateTrimmer(e.no.wordCharacters),e.Pipeline.registerFunction(e.no.trimmer,"trimmer-no"),e.no.stemmer=function(){var r=e.stemmerSupport.Among,n=e.stemmerSupport.SnowballProgram,i=new function(){function e(){var e,r=w.cursor+3;if(a=w.limit,0<=r||r<=w.limit){for(s=r;;){if(e=w.cursor,w.in_grouping(d,97,248)){w.cursor=e;break}if(e>=w.limit)return;w.cursor=e+1}for(;!w.out_grouping(d,97,248);){if(w.cursor>=w.limit)return;w.cursor++}a=w.cursor,a<s&&(a=s)}}function i(){var e,r,n;if(w.cursor>=a&&(r=w.limit_backward,w.limit_backward=a,w.ket=w.cursor,e=w.find_among_b(m,29),w.limit_backward=r,e))switch(w.bra=w.cursor,e){case 1:w.slice_del();break;case 2:n=w.limit-w.cursor,w.in_grouping_b(c,98,122)?w.slice_del():(w.cursor=w.limit-n,w.eq_s_b(1,"k")&&w.out_grouping_b(d,97,248)&&w.slice_del());break;case 3:w.slice_from("er")}}function t(){var e,r=w.limit-w.cursor;w.cursor>=a&&(e=w.limit_backward,w.limit_backward=a,w.ket=w.cursor,w.find_among_b(u,2)?(w.bra=w.cursor,w.limit_backward=e,w.cursor=w.limit-r,w.cursor>w.limit_backward&&(w.cursor--,w.bra=w.cursor,w.slice_del())):w.limit_backward=e)}function o(){var e,r;w.cursor>=a&&(r=w.limit_backward,w.limit_backward=a,w.ket=w.cursor,e=w.find_among_b(l,11),e?(w.bra=w.cursor,w.limit_backward=r,1==e&&w.slice_del()):w.limit_backward=r)}var s,a,m=[new r("a",-1,1),new r("e",-1,1),new r("ede",1,1),new r("ande",1,1),new r("ende",1,1),new r("ane",1,1),new r("ene",1,1),new r("hetene",6,1),new r("erte",1,3),new r("en",-1,1),new r("heten",9,1),new r("ar",-1,1),new r("er",-1,1),new r("heter",12,1),new r("s",-1,2),new r("as",14,1),new r("es",14,1),new r("edes",16,1),new r("endes",16,1),new r("enes",16,1),new r("hetenes",19,1),new r("ens",14,1),new r("hetens",21,1),new r("ers",14,1),new r("ets",14,1),new r("et",-1,1),new r("het",25,1),new r("ert",-1,3),new r("ast",-1,1)],u=[new r("dt",-1,-1),new r("vt",-1,-1)],l=[new r("leg",-1,1),new r("eleg",0,1),new r("ig",-1,1),new r("eig",2,1),new r("lig",2,1),new r("elig",4,1),new r("els",-1,1),new r("lov",-1,1),new r("elov",7,1),new r("slov",7,1),new r("hetslov",9,1)],d=[17,65,16,1,0,0,0,0,0,0,0,0,0,0,0,0,48,0,128],c=[119,125,149,1],w=new n;this.setCurrent=function(e){w.setCurrent(e)},this.getCurrent=function(){return w.getCurrent()},this.stem=function(){var r=w.cursor;return e(),w.limit_backward=r,w.cursor=w.limit,i(),w.cursor=w.limit,t(),w.cursor=w.limit,o(),!0}};return function(e){return"function"==typeof e.update?e.update(function(e){return i.setCurrent(e),i.stem(),i.getCurrent()}):(i.setCurrent(e),i.stem(),i.getCurrent())}}(),e.Pipeline.registerFunction(e.no.stemmer,"stemmer-no"),e.no.stopWordFilter=e.generateStopWordFilter("alle at av bare begge ble blei bli blir blitt både båe da de deg dei deim deira deires dem den denne der dere deres det dette di din disse ditt du dykk dykkar då eg ein eit eitt eller elles en enn er et ett etter for fordi fra før ha hadde han hans har hennar henne hennes her hjå ho hoe honom hoss hossen hun hva hvem hver hvilke hvilken hvis hvor hvordan hvorfor i ikke ikkje ikkje ingen ingi inkje inn inni ja jeg kan kom korleis korso kun kunne kva kvar kvarhelst kven kvi kvifor man mange me med medan meg meget mellom men mi min mine mitt mot mykje ned no noe noen noka noko nokon nokor nokre nå når og også om opp oss over på samme seg selv si si sia sidan siden sin sine sitt sjøl skal skulle slik so som som somme somt så sånn til um upp ut uten var vart varte ved vere verte vi vil ville vore vors vort vår være være vært å".split(" ")),e.Pipeline.registerFunction(e.no.stopWordFilter,"stopWordFilter-no")}});
|
||||||
18
assets/javascripts/lunr/min/lunr.pt.min.js
vendored
Normal file
18
assets/javascripts/lunr/min/lunr.ro.min.js
vendored
Normal file
18
assets/javascripts/lunr/min/lunr.ru.min.js
vendored
Normal file
1
assets/javascripts/lunr/min/lunr.stemmer.support.min.js
vendored
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
!function(r,t){"function"==typeof define&&define.amd?define(t):"object"==typeof exports?module.exports=t():t()(r.lunr)}(this,function(){return function(r){r.stemmerSupport={Among:function(r,t,i,s){if(this.toCharArray=function(r){for(var t=r.length,i=new Array(t),s=0;s<t;s++)i[s]=r.charCodeAt(s);return i},!r&&""!=r||!t&&0!=t||!i)throw"Bad Among initialisation: s:"+r+", substring_i: "+t+", result: "+i;this.s_size=r.length,this.s=this.toCharArray(r),this.substring_i=t,this.result=i,this.method=s},SnowballProgram:function(){var r;return{bra:0,ket:0,limit:0,cursor:0,limit_backward:0,setCurrent:function(t){r=t,this.cursor=0,this.limit=t.length,this.limit_backward=0,this.bra=this.cursor,this.ket=this.limit},getCurrent:function(){var t=r;return r=null,t},in_grouping:function(t,i,s){if(this.cursor<this.limit){var e=r.charCodeAt(this.cursor);if(e<=s&&e>=i&&(e-=i,t[e>>3]&1<<(7&e)))return this.cursor++,!0}return!1},in_grouping_b:function(t,i,s){if(this.cursor>this.limit_backward){var e=r.charCodeAt(this.cursor-1);if(e<=s&&e>=i&&(e-=i,t[e>>3]&1<<(7&e)))return this.cursor--,!0}return!1},out_grouping:function(t,i,s){if(this.cursor<this.limit){var e=r.charCodeAt(this.cursor);if(e>s||e<i)return this.cursor++,!0;if(e-=i,!(t[e>>3]&1<<(7&e)))return this.cursor++,!0}return!1},out_grouping_b:function(t,i,s){if(this.cursor>this.limit_backward){var e=r.charCodeAt(this.cursor-1);if(e>s||e<i)return this.cursor--,!0;if(e-=i,!(t[e>>3]&1<<(7&e)))return this.cursor--,!0}return!1},eq_s:function(t,i){if(this.limit-this.cursor<t)return!1;for(var s=0;s<t;s++)if(r.charCodeAt(this.cursor+s)!=i.charCodeAt(s))return!1;return this.cursor+=t,!0},eq_s_b:function(t,i){if(this.cursor-this.limit_backward<t)return!1;for(var s=0;s<t;s++)if(r.charCodeAt(this.cursor-t+s)!=i.charCodeAt(s))return!1;return this.cursor-=t,!0},find_among:function(t,i){for(var s=0,e=i,n=this.cursor,u=this.limit,o=0,h=0,c=!1;;){for(var a=s+(e-s>>1),f=0,l=o<h?o:h,_=t[a],m=l;m<_.s_size;m++){if(n+l==u){f=-1;break}if(f=r.charCodeAt(n+l)-_.s[m])break;l++}if(f<0?(e=a,h=l):(s=a,o=l),e-s<=1){if(s>0||e==s||c)break;c=!0}}for(;;){var _=t[s];if(o>=_.s_size){if(this.cursor=n+_.s_size,!_.method)return _.result;var b=_.method();if(this.cursor=n+_.s_size,b)return _.result}if((s=_.substring_i)<0)return 0}},find_among_b:function(t,i){for(var s=0,e=i,n=this.cursor,u=this.limit_backward,o=0,h=0,c=!1;;){for(var a=s+(e-s>>1),f=0,l=o<h?o:h,_=t[a],m=_.s_size-1-l;m>=0;m--){if(n-l==u){f=-1;break}if(f=r.charCodeAt(n-1-l)-_.s[m])break;l++}if(f<0?(e=a,h=l):(s=a,o=l),e-s<=1){if(s>0||e==s||c)break;c=!0}}for(;;){var _=t[s];if(o>=_.s_size){if(this.cursor=n-_.s_size,!_.method)return _.result;var b=_.method();if(this.cursor=n-_.s_size,b)return _.result}if((s=_.substring_i)<0)return 0}},replace_s:function(t,i,s){var e=s.length-(i-t),n=r.substring(0,t),u=r.substring(i);return r=n+s+u,this.limit+=e,this.cursor>=i?this.cursor+=e:this.cursor>t&&(this.cursor=t),e},slice_check:function(){if(this.bra<0||this.bra>this.ket||this.ket>this.limit||this.limit>r.length)throw"faulty slice operation"},slice_from:function(r){this.slice_check(),this.replace_s(this.bra,this.ket,r)},slice_del:function(){this.slice_from("")},insert:function(r,t,i){var s=this.replace_s(r,t,i);r<=this.bra&&(this.bra+=s),r<=this.ket&&(this.ket+=s)},slice_to:function(){return this.slice_check(),r.substring(this.bra,this.ket)},eq_v_b:function(r){return this.eq_s_b(r.length,r)}}}},r.trimmerSupport={generateTrimmer:function(r){var t=new RegExp("^[^"+r+"]+"),i=new RegExp("[^"+r+"]+$");return function(r){return"function"==typeof r.update?r.update(function(r){return r.replace(t,"").replace(i,"")}):r.replace(t,"").replace(i,"")}}}}});
|
||||||
18
assets/javascripts/lunr/min/lunr.sv.min.js
vendored
Normal file
|
|
@ -0,0 +1,18 @@
|
||||||
|
/*!
|
||||||
|
* Lunr languages, `Swedish` language
|
||||||
|
* https://github.com/MihaiValentin/lunr-languages
|
||||||
|
*
|
||||||
|
* Copyright 2014, Mihai Valentin
|
||||||
|
* http://www.mozilla.org/MPL/
|
||||||
|
*/
|
||||||
|
/*!
|
||||||
|
* based on
|
||||||
|
* Snowball JavaScript Library v0.3
|
||||||
|
* http://code.google.com/p/urim/
|
||||||
|
* http://snowball.tartarus.org/
|
||||||
|
*
|
||||||
|
* Copyright 2010, Oleg Mazko
|
||||||
|
* http://www.mozilla.org/MPL/
|
||||||
|
*/
|
||||||
|
|
||||||
|
!function(e,r){"function"==typeof define&&define.amd?define(r):"object"==typeof exports?module.exports=r():r()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");e.sv=function(){this.pipeline.reset(),this.pipeline.add(e.sv.trimmer,e.sv.stopWordFilter,e.sv.stemmer),this.searchPipeline&&(this.searchPipeline.reset(),this.searchPipeline.add(e.sv.stemmer))},e.sv.wordCharacters="A-Za-zªºÀ-ÖØ-öø-ʸˠ-ˤᴀ-ᴥᴬ-ᵜᵢ-ᵥᵫ-ᵷᵹ-ᶾḀ-ỿⁱⁿₐ-ₜKÅℲⅎⅠ-ↈⱠ-ⱿꜢ-ꞇꞋ-ꞭꞰ-ꞷꟷ-ꟿꬰ-ꭚꭜ-ꭤff-stA-Za-z",e.sv.trimmer=e.trimmerSupport.generateTrimmer(e.sv.wordCharacters),e.Pipeline.registerFunction(e.sv.trimmer,"trimmer-sv"),e.sv.stemmer=function(){var r=e.stemmerSupport.Among,n=e.stemmerSupport.SnowballProgram,t=new function(){function e(){var e,r=w.cursor+3;if(o=w.limit,0<=r||r<=w.limit){for(a=r;;){if(e=w.cursor,w.in_grouping(l,97,246)){w.cursor=e;break}if(w.cursor=e,w.cursor>=w.limit)return;w.cursor++}for(;!w.out_grouping(l,97,246);){if(w.cursor>=w.limit)return;w.cursor++}o=w.cursor,o<a&&(o=a)}}function t(){var e,r=w.limit_backward;if(w.cursor>=o&&(w.limit_backward=o,w.cursor=w.limit,w.ket=w.cursor,e=w.find_among_b(u,37),w.limit_backward=r,e))switch(w.bra=w.cursor,e){case 1:w.slice_del();break;case 2:w.in_grouping_b(d,98,121)&&w.slice_del()}}function i(){var e=w.limit_backward;w.cursor>=o&&(w.limit_backward=o,w.cursor=w.limit,w.find_among_b(c,7)&&(w.cursor=w.limit,w.ket=w.cursor,w.cursor>w.limit_backward&&(w.bra=--w.cursor,w.slice_del())),w.limit_backward=e)}function s(){var e,r;if(w.cursor>=o){if(r=w.limit_backward,w.limit_backward=o,w.cursor=w.limit,w.ket=w.cursor,e=w.find_among_b(m,5))switch(w.bra=w.cursor,e){case 1:w.slice_del();break;case 2:w.slice_from("lös");break;case 3:w.slice_from("full")}w.limit_backward=r}}var a,o,u=[new r("a",-1,1),new r("arna",0,1),new r("erna",0,1),new r("heterna",2,1),new r("orna",0,1),new r("ad",-1,1),new r("e",-1,1),new r("ade",6,1),new r("ande",6,1),new r("arne",6,1),new r("are",6,1),new r("aste",6,1),new r("en",-1,1),new r("anden",12,1),new r("aren",12,1),new r("heten",12,1),new r("ern",-1,1),new r("ar",-1,1),new r("er",-1,1),new r("heter",18,1),new r("or",-1,1),new r("s",-1,2),new r("as",21,1),new r("arnas",22,1),new r("ernas",22,1),new r("ornas",22,1),new r("es",21,1),new r("ades",26,1),new r("andes",26,1),new r("ens",21,1),new r("arens",29,1),new r("hetens",29,1),new r("erns",21,1),new r("at",-1,1),new r("andet",-1,1),new r("het",-1,1),new r("ast",-1,1)],c=[new r("dd",-1,-1),new r("gd",-1,-1),new r("nn",-1,-1),new r("dt",-1,-1),new r("gt",-1,-1),new r("kt",-1,-1),new r("tt",-1,-1)],m=[new r("ig",-1,1),new r("lig",0,1),new r("els",-1,1),new r("fullt",-1,3),new r("löst",-1,2)],l=[17,65,16,1,0,0,0,0,0,0,0,0,0,0,0,0,24,0,32],d=[119,127,149],w=new n;this.setCurrent=function(e){w.setCurrent(e)},this.getCurrent=function(){return w.getCurrent()},this.stem=function(){var r=w.cursor;return e(),w.limit_backward=r,w.cursor=w.limit,t(),w.cursor=w.limit,i(),w.cursor=w.limit,s(),!0}};return function(e){return"function"==typeof e.update?e.update(function(e){return t.setCurrent(e),t.stem(),t.getCurrent()}):(t.setCurrent(e),t.stem(),t.getCurrent())}}(),e.Pipeline.registerFunction(e.sv.stemmer,"stemmer-sv"),e.sv.stopWordFilter=e.generateStopWordFilter("alla allt att av blev bli blir blivit de dem den denna deras dess dessa det detta dig din dina ditt du där då efter ej eller en er era ert ett från för ha hade han hans har henne hennes hon honom hur här i icke ingen inom inte jag ju kan kunde man med mellan men mig min mina mitt mot mycket ni nu när någon något några och om oss på samma sedan sig sin sina sitta själv skulle som så sådan sådana sådant till under upp ut utan vad var vara varför varit varje vars vart vem vi vid vilka vilkas vilken vilket vår våra vårt än är åt över".split(" ")),e.Pipeline.registerFunction(e.sv.stopWordFilter,"stopWordFilter-sv")}});
|
||||||
1
assets/javascripts/lunr/min/lunr.ta.min.js
vendored
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
!function(e,t){"function"==typeof define&&define.amd?define(t):"object"==typeof exports?module.exports=t():t()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");e.ta=function(){this.pipeline.reset(),this.pipeline.add(e.ta.trimmer,e.ta.stopWordFilter,e.ta.stemmer),this.searchPipeline&&(this.searchPipeline.reset(),this.searchPipeline.add(e.ta.stemmer))},e.ta.wordCharacters="-உஊ-ஏஐ-ஙச-ட-னப-யர-ஹ-ிீ-ொ-ௐ---௩௪-௯௰-௹௺-a-zA-Za-zA-Z0-90-9",e.ta.trimmer=e.trimmerSupport.generateTrimmer(e.ta.wordCharacters),e.Pipeline.registerFunction(e.ta.trimmer,"trimmer-ta"),e.ta.stopWordFilter=e.generateStopWordFilter("அங்கு அங்கே அது அதை அந்த அவர் அவர்கள் அவள் அவன் அவை ஆக ஆகவே ஆகையால் ஆதலால் ஆதலினால் ஆனாலும் ஆனால் இங்கு இங்கே இது இதை இந்த இப்படி இவர் இவர்கள் இவள் இவன் இவை இவ்வளவு உனக்கு உனது உன் உன்னால் எங்கு எங்கே எது எதை எந்த எப்படி எவர் எவர்கள் எவள் எவன் எவை எவ்வளவு எனக்கு எனது எனவே என் என்ன என்னால் ஏது ஏன் தனது தன்னால் தானே தான் நாங்கள் நாம் நான் நீ நீங்கள்".split(" ")),e.ta.stemmer=function(){return function(e){return"function"==typeof e.update?e.update(function(e){return e}):e}}();var t=e.wordcut;t.init(),e.ta.tokenizer=function(r){if(!arguments.length||null==r||void 0==r)return[];if(Array.isArray(r))return r.map(function(t){return isLunr2?new e.Token(t.toLowerCase()):t.toLowerCase()});var i=r.toString().toLowerCase().replace(/^\s+/,"");return t.cut(i).split("|")},e.Pipeline.registerFunction(e.ta.stemmer,"stemmer-ta"),e.Pipeline.registerFunction(e.ta.stopWordFilter,"stopWordFilter-ta")}});
|
||||||
1
assets/javascripts/lunr/min/lunr.th.min.js
vendored
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
!function(e,r){"function"==typeof define&&define.amd?define(r):"object"==typeof exports?module.exports=r():r()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");var r="2"==e.version[0];e.th=function(){this.pipeline.reset(),this.pipeline.add(e.th.trimmer),r?this.tokenizer=e.th.tokenizer:(e.tokenizer&&(e.tokenizer=e.th.tokenizer),this.tokenizerFn&&(this.tokenizerFn=e.th.tokenizer))},e.th.wordCharacters="[-]",e.th.trimmer=e.trimmerSupport.generateTrimmer(e.th.wordCharacters),e.Pipeline.registerFunction(e.th.trimmer,"trimmer-th");var t=e.wordcut;t.init(),e.th.tokenizer=function(i){if(!arguments.length||null==i||void 0==i)return[];if(Array.isArray(i))return i.map(function(t){return r?new e.Token(t):t});var n=i.toString().replace(/^\s+/,"");return t.cut(n).split("|")}}});
|
||||||
18
assets/javascripts/lunr/min/lunr.tr.min.js
vendored
Normal file
1
assets/javascripts/lunr/min/lunr.vi.min.js
vendored
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
!function(e,r){"function"==typeof define&&define.amd?define(r):"object"==typeof exports?module.exports=r():r()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");e.vi=function(){this.pipeline.reset(),this.pipeline.add(e.vi.stopWordFilter,e.vi.trimmer)},e.vi.wordCharacters="[A-Za-ẓ̀͐́͑̉̃̓ÂâÊêÔôĂ-ăĐ-đƠ-ơƯ-ư]",e.vi.trimmer=e.trimmerSupport.generateTrimmer(e.vi.wordCharacters),e.Pipeline.registerFunction(e.vi.trimmer,"trimmer-vi"),e.vi.stopWordFilter=e.generateStopWordFilter("là cái nhưng mà".split(" "))}});
|
||||||
1
assets/javascripts/lunr/min/lunr.zh.min.js
vendored
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
!function(e,r){"function"==typeof define&&define.amd?define(r):"object"==typeof exports?module.exports=r(require("@node-rs/jieba")):r()(e.lunr)}(this,function(e){return function(r,t){if(void 0===r)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===r.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");var i="2"==r.version[0];r.zh=function(){this.pipeline.reset(),this.pipeline.add(r.zh.trimmer,r.zh.stopWordFilter,r.zh.stemmer),i?this.tokenizer=r.zh.tokenizer:(r.tokenizer&&(r.tokenizer=r.zh.tokenizer),this.tokenizerFn&&(this.tokenizerFn=r.zh.tokenizer))},r.zh.tokenizer=function(n){if(!arguments.length||null==n||void 0==n)return[];if(Array.isArray(n))return n.map(function(e){return i?new r.Token(e.toLowerCase()):e.toLowerCase()});t&&e.load(t);var o=n.toString().trim().toLowerCase(),s=[];e.cut(o,!0).forEach(function(e){s=s.concat(e.split(" "))}),s=s.filter(function(e){return!!e});var u=0;return s.map(function(e,t){if(i){var n=o.indexOf(e,u),s={};return s.position=[n,e.length],s.index=t,u=n,new r.Token(e,s)}return e})},r.zh.wordCharacters="\\w一-龥",r.zh.trimmer=r.trimmerSupport.generateTrimmer(r.zh.wordCharacters),r.Pipeline.registerFunction(r.zh.trimmer,"trimmer-zh"),r.zh.stemmer=function(){return function(e){return e}}(),r.Pipeline.registerFunction(r.zh.stemmer,"stemmer-zh"),r.zh.stopWordFilter=r.generateStopWordFilter("的 一 不 在 人 有 是 为 以 于 上 他 而 后 之 来 及 了 因 下 可 到 由 这 与 也 此 但 并 个 其 已 无 小 我 们 起 最 再 今 去 好 只 又 或 很 亦 某 把 那 你 乃 它 吧 被 比 别 趁 当 从 到 得 打 凡 儿 尔 该 各 给 跟 和 何 还 即 几 既 看 据 距 靠 啦 了 另 么 每 们 嘛 拿 哪 那 您 凭 且 却 让 仍 啥 如 若 使 谁 虽 随 同 所 她 哇 嗡 往 哪 些 向 沿 哟 用 于 咱 则 怎 曾 至 致 着 诸 自".split(" ")),r.Pipeline.registerFunction(r.zh.stopWordFilter,"stopWordFilter-zh")}});
|
||||||
206
assets/javascripts/lunr/tinyseg.js
Normal file
|
|
@ -0,0 +1,206 @@
|
||||||
|
/**
|
||||||
|
* export the module via AMD, CommonJS or as a browser global
|
||||||
|
* Export code from https://github.com/umdjs/umd/blob/master/returnExports.js
|
||||||
|
*/
|
||||||
|
;(function (root, factory) {
|
||||||
|
if (typeof define === 'function' && define.amd) {
|
||||||
|
// AMD. Register as an anonymous module.
|
||||||
|
define(factory)
|
||||||
|
} else if (typeof exports === 'object') {
|
||||||
|
/**
|
||||||
|
* Node. Does not work with strict CommonJS, but
|
||||||
|
* only CommonJS-like environments that support module.exports,
|
||||||
|
* like Node.
|
||||||
|
*/
|
||||||
|
module.exports = factory()
|
||||||
|
} else {
|
||||||
|
// Browser globals (root is window)
|
||||||
|
factory()(root.lunr);
|
||||||
|
}
|
||||||
|
}(this, function () {
|
||||||
|
/**
|
||||||
|
* Just return a value to define the module export.
|
||||||
|
* This example returns an object, but the module
|
||||||
|
* can return a function as the exported value.
|
||||||
|
*/
|
||||||
|
|
||||||
|
return function(lunr) {
|
||||||
|
// TinySegmenter 0.1 -- Super compact Japanese tokenizer in Javascript
|
||||||
|
// (c) 2008 Taku Kudo <taku@chasen.org>
|
||||||
|
// TinySegmenter is freely distributable under the terms of a new BSD licence.
|
||||||
|
// For details, see http://chasen.org/~taku/software/TinySegmenter/LICENCE.txt
|
||||||
|
|
||||||
|
function TinySegmenter() {
|
||||||
|
var patterns = {
|
||||||
|
"[一二三四五六七八九十百千万億兆]":"M",
|
||||||
|
"[一-龠々〆ヵヶ]":"H",
|
||||||
|
"[ぁ-ん]":"I",
|
||||||
|
"[ァ-ヴーア-ン゙ー]":"K",
|
||||||
|
"[a-zA-Za-zA-Z]":"A",
|
||||||
|
"[0-90-9]":"N"
|
||||||
|
}
|
||||||
|
this.chartype_ = [];
|
||||||
|
for (var i in patterns) {
|
||||||
|
var regexp = new RegExp(i);
|
||||||
|
this.chartype_.push([regexp, patterns[i]]);
|
||||||
|
}
|
||||||
|
|
||||||
|
this.BIAS__ = -332
|
||||||
|
this.BC1__ = {"HH":6,"II":2461,"KH":406,"OH":-1378};
|
||||||
|
this.BC2__ = {"AA":-3267,"AI":2744,"AN":-878,"HH":-4070,"HM":-1711,"HN":4012,"HO":3761,"IA":1327,"IH":-1184,"II":-1332,"IK":1721,"IO":5492,"KI":3831,"KK":-8741,"MH":-3132,"MK":3334,"OO":-2920};
|
||||||
|
this.BC3__ = {"HH":996,"HI":626,"HK":-721,"HN":-1307,"HO":-836,"IH":-301,"KK":2762,"MK":1079,"MM":4034,"OA":-1652,"OH":266};
|
||||||
|
this.BP1__ = {"BB":295,"OB":304,"OO":-125,"UB":352};
|
||||||
|
this.BP2__ = {"BO":60,"OO":-1762};
|
||||||
|
this.BQ1__ = {"BHH":1150,"BHM":1521,"BII":-1158,"BIM":886,"BMH":1208,"BNH":449,"BOH":-91,"BOO":-2597,"OHI":451,"OIH":-296,"OKA":1851,"OKH":-1020,"OKK":904,"OOO":2965};
|
||||||
|
this.BQ2__ = {"BHH":118,"BHI":-1159,"BHM":466,"BIH":-919,"BKK":-1720,"BKO":864,"OHH":-1139,"OHM":-181,"OIH":153,"UHI":-1146};
|
||||||
|
this.BQ3__ = {"BHH":-792,"BHI":2664,"BII":-299,"BKI":419,"BMH":937,"BMM":8335,"BNN":998,"BOH":775,"OHH":2174,"OHM":439,"OII":280,"OKH":1798,"OKI":-793,"OKO":-2242,"OMH":-2402,"OOO":11699};
|
||||||
|
this.BQ4__ = {"BHH":-3895,"BIH":3761,"BII":-4654,"BIK":1348,"BKK":-1806,"BMI":-3385,"BOO":-12396,"OAH":926,"OHH":266,"OHK":-2036,"ONN":-973};
|
||||||
|
this.BW1__ = {",と":660,",同":727,"B1あ":1404,"B1同":542,"、と":660,"、同":727,"」と":1682,"あっ":1505,"いう":1743,"いっ":-2055,"いる":672,"うし":-4817,"うん":665,"から":3472,"がら":600,"こう":-790,"こと":2083,"こん":-1262,"さら":-4143,"さん":4573,"した":2641,"して":1104,"すで":-3399,"そこ":1977,"それ":-871,"たち":1122,"ため":601,"った":3463,"つい":-802,"てい":805,"てき":1249,"でき":1127,"です":3445,"では":844,"とい":-4915,"とみ":1922,"どこ":3887,"ない":5713,"なっ":3015,"など":7379,"なん":-1113,"にし":2468,"には":1498,"にも":1671,"に対":-912,"の一":-501,"の中":741,"ませ":2448,"まで":1711,"まま":2600,"まる":-2155,"やむ":-1947,"よっ":-2565,"れた":2369,"れで":-913,"をし":1860,"を見":731,"亡く":-1886,"京都":2558,"取り":-2784,"大き":-2604,"大阪":1497,"平方":-2314,"引き":-1336,"日本":-195,"本当":-2423,"毎日":-2113,"目指":-724,"B1あ":1404,"B1同":542,"」と":1682};
|
||||||
|
this.BW2__ = {"..":-11822,"11":-669,"――":-5730,"−−":-13175,"いう":-1609,"うか":2490,"かし":-1350,"かも":-602,"から":-7194,"かれ":4612,"がい":853,"がら":-3198,"きた":1941,"くな":-1597,"こと":-8392,"この":-4193,"させ":4533,"され":13168,"さん":-3977,"しい":-1819,"しか":-545,"した":5078,"して":972,"しな":939,"その":-3744,"たい":-1253,"たた":-662,"ただ":-3857,"たち":-786,"たと":1224,"たは":-939,"った":4589,"って":1647,"っと":-2094,"てい":6144,"てき":3640,"てく":2551,"ては":-3110,"ても":-3065,"でい":2666,"でき":-1528,"でし":-3828,"です":-4761,"でも":-4203,"とい":1890,"とこ":-1746,"とと":-2279,"との":720,"とみ":5168,"とも":-3941,"ない":-2488,"なが":-1313,"など":-6509,"なの":2614,"なん":3099,"にお":-1615,"にし":2748,"にな":2454,"によ":-7236,"に対":-14943,"に従":-4688,"に関":-11388,"のか":2093,"ので":-7059,"のに":-6041,"のの":-6125,"はい":1073,"はが":-1033,"はず":-2532,"ばれ":1813,"まし":-1316,"まで":-6621,"まれ":5409,"めて":-3153,"もい":2230,"もの":-10713,"らか":-944,"らし":-1611,"らに":-1897,"りし":651,"りま":1620,"れた":4270,"れて":849,"れば":4114,"ろう":6067,"われ":7901,"を通":-11877,"んだ":728,"んな":-4115,"一人":602,"一方":-1375,"一日":970,"一部":-1051,"上が":-4479,"会社":-1116,"出て":2163,"分の":-7758,"同党":970,"同日":-913,"大阪":-2471,"委員":-1250,"少な":-1050,"年度":-8669,"年間":-1626,"府県":-2363,"手権":-1982,"新聞":-4066,"日新":-722,"日本":-7068,"日米":3372,"曜日":-601,"朝鮮":-2355,"本人":-2697,"東京":-1543,"然と":-1384,"社会":-1276,"立て":-990,"第に":-1612,"米国":-4268,"11":-669};
|
||||||
|
this.BW3__ = {"あた":-2194,"あり":719,"ある":3846,"い.":-1185,"い。":-1185,"いい":5308,"いえ":2079,"いく":3029,"いた":2056,"いっ":1883,"いる":5600,"いわ":1527,"うち":1117,"うと":4798,"えと":1454,"か.":2857,"か。":2857,"かけ":-743,"かっ":-4098,"かに":-669,"から":6520,"かり":-2670,"が,":1816,"が、":1816,"がき":-4855,"がけ":-1127,"がっ":-913,"がら":-4977,"がり":-2064,"きた":1645,"けど":1374,"こと":7397,"この":1542,"ころ":-2757,"さい":-714,"さを":976,"し,":1557,"し、":1557,"しい":-3714,"した":3562,"して":1449,"しな":2608,"しま":1200,"す.":-1310,"す。":-1310,"する":6521,"ず,":3426,"ず、":3426,"ずに":841,"そう":428,"た.":8875,"た。":8875,"たい":-594,"たの":812,"たり":-1183,"たる":-853,"だ.":4098,"だ。":4098,"だっ":1004,"った":-4748,"って":300,"てい":6240,"てお":855,"ても":302,"です":1437,"でに":-1482,"では":2295,"とう":-1387,"とし":2266,"との":541,"とも":-3543,"どう":4664,"ない":1796,"なく":-903,"など":2135,"に,":-1021,"に、":-1021,"にし":1771,"にな":1906,"には":2644,"の,":-724,"の、":-724,"の子":-1000,"は,":1337,"は、":1337,"べき":2181,"まし":1113,"ます":6943,"まっ":-1549,"まで":6154,"まれ":-793,"らし":1479,"られ":6820,"るる":3818,"れ,":854,"れ、":854,"れた":1850,"れて":1375,"れば":-3246,"れる":1091,"われ":-605,"んだ":606,"んで":798,"カ月":990,"会議":860,"入り":1232,"大会":2217,"始め":1681,"市":965,"新聞":-5055,"日,":974,"日、":974,"社会":2024,"カ月":990};
|
||||||
|
this.TC1__ = {"AAA":1093,"HHH":1029,"HHM":580,"HII":998,"HOH":-390,"HOM":-331,"IHI":1169,"IOH":-142,"IOI":-1015,"IOM":467,"MMH":187,"OOI":-1832};
|
||||||
|
this.TC2__ = {"HHO":2088,"HII":-1023,"HMM":-1154,"IHI":-1965,"KKH":703,"OII":-2649};
|
||||||
|
this.TC3__ = {"AAA":-294,"HHH":346,"HHI":-341,"HII":-1088,"HIK":731,"HOH":-1486,"IHH":128,"IHI":-3041,"IHO":-1935,"IIH":-825,"IIM":-1035,"IOI":-542,"KHH":-1216,"KKA":491,"KKH":-1217,"KOK":-1009,"MHH":-2694,"MHM":-457,"MHO":123,"MMH":-471,"NNH":-1689,"NNO":662,"OHO":-3393};
|
||||||
|
this.TC4__ = {"HHH":-203,"HHI":1344,"HHK":365,"HHM":-122,"HHN":182,"HHO":669,"HIH":804,"HII":679,"HOH":446,"IHH":695,"IHO":-2324,"IIH":321,"III":1497,"IIO":656,"IOO":54,"KAK":4845,"KKA":3386,"KKK":3065,"MHH":-405,"MHI":201,"MMH":-241,"MMM":661,"MOM":841};
|
||||||
|
this.TQ1__ = {"BHHH":-227,"BHHI":316,"BHIH":-132,"BIHH":60,"BIII":1595,"BNHH":-744,"BOHH":225,"BOOO":-908,"OAKK":482,"OHHH":281,"OHIH":249,"OIHI":200,"OIIH":-68};
|
||||||
|
this.TQ2__ = {"BIHH":-1401,"BIII":-1033,"BKAK":-543,"BOOO":-5591};
|
||||||
|
this.TQ3__ = {"BHHH":478,"BHHM":-1073,"BHIH":222,"BHII":-504,"BIIH":-116,"BIII":-105,"BMHI":-863,"BMHM":-464,"BOMH":620,"OHHH":346,"OHHI":1729,"OHII":997,"OHMH":481,"OIHH":623,"OIIH":1344,"OKAK":2792,"OKHH":587,"OKKA":679,"OOHH":110,"OOII":-685};
|
||||||
|
this.TQ4__ = {"BHHH":-721,"BHHM":-3604,"BHII":-966,"BIIH":-607,"BIII":-2181,"OAAA":-2763,"OAKK":180,"OHHH":-294,"OHHI":2446,"OHHO":480,"OHIH":-1573,"OIHH":1935,"OIHI":-493,"OIIH":626,"OIII":-4007,"OKAK":-8156};
|
||||||
|
this.TW1__ = {"につい":-4681,"東京都":2026};
|
||||||
|
this.TW2__ = {"ある程":-2049,"いった":-1256,"ころが":-2434,"しょう":3873,"その後":-4430,"だって":-1049,"ていた":1833,"として":-4657,"ともに":-4517,"もので":1882,"一気に":-792,"初めて":-1512,"同時に":-8097,"大きな":-1255,"対して":-2721,"社会党":-3216};
|
||||||
|
this.TW3__ = {"いただ":-1734,"してい":1314,"として":-4314,"につい":-5483,"にとっ":-5989,"に当た":-6247,"ので,":-727,"ので、":-727,"のもの":-600,"れから":-3752,"十二月":-2287};
|
||||||
|
this.TW4__ = {"いう.":8576,"いう。":8576,"からな":-2348,"してい":2958,"たが,":1516,"たが、":1516,"ている":1538,"という":1349,"ました":5543,"ません":1097,"ようと":-4258,"よると":5865};
|
||||||
|
this.UC1__ = {"A":484,"K":93,"M":645,"O":-505};
|
||||||
|
this.UC2__ = {"A":819,"H":1059,"I":409,"M":3987,"N":5775,"O":646};
|
||||||
|
this.UC3__ = {"A":-1370,"I":2311};
|
||||||
|
this.UC4__ = {"A":-2643,"H":1809,"I":-1032,"K":-3450,"M":3565,"N":3876,"O":6646};
|
||||||
|
this.UC5__ = {"H":313,"I":-1238,"K":-799,"M":539,"O":-831};
|
||||||
|
this.UC6__ = {"H":-506,"I":-253,"K":87,"M":247,"O":-387};
|
||||||
|
this.UP1__ = {"O":-214};
|
||||||
|
this.UP2__ = {"B":69,"O":935};
|
||||||
|
this.UP3__ = {"B":189};
|
||||||
|
this.UQ1__ = {"BH":21,"BI":-12,"BK":-99,"BN":142,"BO":-56,"OH":-95,"OI":477,"OK":410,"OO":-2422};
|
||||||
|
this.UQ2__ = {"BH":216,"BI":113,"OK":1759};
|
||||||
|
this.UQ3__ = {"BA":-479,"BH":42,"BI":1913,"BK":-7198,"BM":3160,"BN":6427,"BO":14761,"OI":-827,"ON":-3212};
|
||||||
|
this.UW1__ = {",":156,"、":156,"「":-463,"あ":-941,"う":-127,"が":-553,"き":121,"こ":505,"で":-201,"と":-547,"ど":-123,"に":-789,"の":-185,"は":-847,"も":-466,"や":-470,"よ":182,"ら":-292,"り":208,"れ":169,"を":-446,"ん":-137,"・":-135,"主":-402,"京":-268,"区":-912,"午":871,"国":-460,"大":561,"委":729,"市":-411,"日":-141,"理":361,"生":-408,"県":-386,"都":-718,"「":-463,"・":-135};
|
||||||
|
this.UW2__ = {",":-829,"、":-829,"〇":892,"「":-645,"」":3145,"あ":-538,"い":505,"う":134,"お":-502,"か":1454,"が":-856,"く":-412,"こ":1141,"さ":878,"ざ":540,"し":1529,"す":-675,"せ":300,"そ":-1011,"た":188,"だ":1837,"つ":-949,"て":-291,"で":-268,"と":-981,"ど":1273,"な":1063,"に":-1764,"の":130,"は":-409,"ひ":-1273,"べ":1261,"ま":600,"も":-1263,"や":-402,"よ":1639,"り":-579,"る":-694,"れ":571,"を":-2516,"ん":2095,"ア":-587,"カ":306,"キ":568,"ッ":831,"三":-758,"不":-2150,"世":-302,"中":-968,"主":-861,"事":492,"人":-123,"会":978,"保":362,"入":548,"初":-3025,"副":-1566,"北":-3414,"区":-422,"大":-1769,"天":-865,"太":-483,"子":-1519,"学":760,"実":1023,"小":-2009,"市":-813,"年":-1060,"強":1067,"手":-1519,"揺":-1033,"政":1522,"文":-1355,"新":-1682,"日":-1815,"明":-1462,"最":-630,"朝":-1843,"本":-1650,"東":-931,"果":-665,"次":-2378,"民":-180,"気":-1740,"理":752,"発":529,"目":-1584,"相":-242,"県":-1165,"立":-763,"第":810,"米":509,"自":-1353,"行":838,"西":-744,"見":-3874,"調":1010,"議":1198,"込":3041,"開":1758,"間":-1257,"「":-645,"」":3145,"ッ":831,"ア":-587,"カ":306,"キ":568};
|
||||||
|
this.UW3__ = {",":4889,"1":-800,"−":-1723,"、":4889,"々":-2311,"〇":5827,"」":2670,"〓":-3573,"あ":-2696,"い":1006,"う":2342,"え":1983,"お":-4864,"か":-1163,"が":3271,"く":1004,"け":388,"げ":401,"こ":-3552,"ご":-3116,"さ":-1058,"し":-395,"す":584,"せ":3685,"そ":-5228,"た":842,"ち":-521,"っ":-1444,"つ":-1081,"て":6167,"で":2318,"と":1691,"ど":-899,"な":-2788,"に":2745,"の":4056,"は":4555,"ひ":-2171,"ふ":-1798,"へ":1199,"ほ":-5516,"ま":-4384,"み":-120,"め":1205,"も":2323,"や":-788,"よ":-202,"ら":727,"り":649,"る":5905,"れ":2773,"わ":-1207,"を":6620,"ん":-518,"ア":551,"グ":1319,"ス":874,"ッ":-1350,"ト":521,"ム":1109,"ル":1591,"ロ":2201,"ン":278,"・":-3794,"一":-1619,"下":-1759,"世":-2087,"両":3815,"中":653,"主":-758,"予":-1193,"二":974,"人":2742,"今":792,"他":1889,"以":-1368,"低":811,"何":4265,"作":-361,"保":-2439,"元":4858,"党":3593,"全":1574,"公":-3030,"六":755,"共":-1880,"円":5807,"再":3095,"分":457,"初":2475,"別":1129,"前":2286,"副":4437,"力":365,"動":-949,"務":-1872,"化":1327,"北":-1038,"区":4646,"千":-2309,"午":-783,"協":-1006,"口":483,"右":1233,"各":3588,"合":-241,"同":3906,"和":-837,"員":4513,"国":642,"型":1389,"場":1219,"外":-241,"妻":2016,"学":-1356,"安":-423,"実":-1008,"家":1078,"小":-513,"少":-3102,"州":1155,"市":3197,"平":-1804,"年":2416,"広":-1030,"府":1605,"度":1452,"建":-2352,"当":-3885,"得":1905,"思":-1291,"性":1822,"戸":-488,"指":-3973,"政":-2013,"教":-1479,"数":3222,"文":-1489,"新":1764,"日":2099,"旧":5792,"昨":-661,"時":-1248,"曜":-951,"最":-937,"月":4125,"期":360,"李":3094,"村":364,"東":-805,"核":5156,"森":2438,"業":484,"氏":2613,"民":-1694,"決":-1073,"法":1868,"海":-495,"無":979,"物":461,"特":-3850,"生":-273,"用":914,"町":1215,"的":7313,"直":-1835,"省":792,"県":6293,"知":-1528,"私":4231,"税":401,"立":-960,"第":1201,"米":7767,"系":3066,"約":3663,"級":1384,"統":-4229,"総":1163,"線":1255,"者":6457,"能":725,"自":-2869,"英":785,"見":1044,"調":-562,"財":-733,"費":1777,"車":1835,"軍":1375,"込":-1504,"通":-1136,"選":-681,"郎":1026,"郡":4404,"部":1200,"金":2163,"長":421,"開":-1432,"間":1302,"関":-1282,"雨":2009,"電":-1045,"非":2066,"駅":1620,"1":-800,"」":2670,"・":-3794,"ッ":-1350,"ア":551,"グ":1319,"ス":874,"ト":521,"ム":1109,"ル":1591,"ロ":2201,"ン":278};
|
||||||
|
this.UW4__ = {",":3930,".":3508,"―":-4841,"、":3930,"。":3508,"〇":4999,"「":1895,"」":3798,"〓":-5156,"あ":4752,"い":-3435,"う":-640,"え":-2514,"お":2405,"か":530,"が":6006,"き":-4482,"ぎ":-3821,"く":-3788,"け":-4376,"げ":-4734,"こ":2255,"ご":1979,"さ":2864,"し":-843,"じ":-2506,"す":-731,"ず":1251,"せ":181,"そ":4091,"た":5034,"だ":5408,"ち":-3654,"っ":-5882,"つ":-1659,"て":3994,"で":7410,"と":4547,"な":5433,"に":6499,"ぬ":1853,"ね":1413,"の":7396,"は":8578,"ば":1940,"ひ":4249,"び":-4134,"ふ":1345,"へ":6665,"べ":-744,"ほ":1464,"ま":1051,"み":-2082,"む":-882,"め":-5046,"も":4169,"ゃ":-2666,"や":2795,"ょ":-1544,"よ":3351,"ら":-2922,"り":-9726,"る":-14896,"れ":-2613,"ろ":-4570,"わ":-1783,"を":13150,"ん":-2352,"カ":2145,"コ":1789,"セ":1287,"ッ":-724,"ト":-403,"メ":-1635,"ラ":-881,"リ":-541,"ル":-856,"ン":-3637,"・":-4371,"ー":-11870,"一":-2069,"中":2210,"予":782,"事":-190,"井":-1768,"人":1036,"以":544,"会":950,"体":-1286,"作":530,"側":4292,"先":601,"党":-2006,"共":-1212,"内":584,"円":788,"初":1347,"前":1623,"副":3879,"力":-302,"動":-740,"務":-2715,"化":776,"区":4517,"協":1013,"参":1555,"合":-1834,"和":-681,"員":-910,"器":-851,"回":1500,"国":-619,"園":-1200,"地":866,"場":-1410,"塁":-2094,"士":-1413,"多":1067,"大":571,"子":-4802,"学":-1397,"定":-1057,"寺":-809,"小":1910,"屋":-1328,"山":-1500,"島":-2056,"川":-2667,"市":2771,"年":374,"庁":-4556,"後":456,"性":553,"感":916,"所":-1566,"支":856,"改":787,"政":2182,"教":704,"文":522,"方":-856,"日":1798,"時":1829,"最":845,"月":-9066,"木":-485,"来":-442,"校":-360,"業":-1043,"氏":5388,"民":-2716,"気":-910,"沢":-939,"済":-543,"物":-735,"率":672,"球":-1267,"生":-1286,"産":-1101,"田":-2900,"町":1826,"的":2586,"目":922,"省":-3485,"県":2997,"空":-867,"立":-2112,"第":788,"米":2937,"系":786,"約":2171,"経":1146,"統":-1169,"総":940,"線":-994,"署":749,"者":2145,"能":-730,"般":-852,"行":-792,"規":792,"警":-1184,"議":-244,"谷":-1000,"賞":730,"車":-1481,"軍":1158,"輪":-1433,"込":-3370,"近":929,"道":-1291,"選":2596,"郎":-4866,"都":1192,"野":-1100,"銀":-2213,"長":357,"間":-2344,"院":-2297,"際":-2604,"電":-878,"領":-1659,"題":-792,"館":-1984,"首":1749,"高":2120,"「":1895,"」":3798,"・":-4371,"ッ":-724,"ー":-11870,"カ":2145,"コ":1789,"セ":1287,"ト":-403,"メ":-1635,"ラ":-881,"リ":-541,"ル":-856,"ン":-3637};
|
||||||
|
this.UW5__ = {",":465,".":-299,"1":-514,"E2":-32768,"]":-2762,"、":465,"。":-299,"「":363,"あ":1655,"い":331,"う":-503,"え":1199,"お":527,"か":647,"が":-421,"き":1624,"ぎ":1971,"く":312,"げ":-983,"さ":-1537,"し":-1371,"す":-852,"だ":-1186,"ち":1093,"っ":52,"つ":921,"て":-18,"で":-850,"と":-127,"ど":1682,"な":-787,"に":-1224,"の":-635,"は":-578,"べ":1001,"み":502,"め":865,"ゃ":3350,"ょ":854,"り":-208,"る":429,"れ":504,"わ":419,"を":-1264,"ん":327,"イ":241,"ル":451,"ン":-343,"中":-871,"京":722,"会":-1153,"党":-654,"務":3519,"区":-901,"告":848,"員":2104,"大":-1296,"学":-548,"定":1785,"嵐":-1304,"市":-2991,"席":921,"年":1763,"思":872,"所":-814,"挙":1618,"新":-1682,"日":218,"月":-4353,"査":932,"格":1356,"機":-1508,"氏":-1347,"田":240,"町":-3912,"的":-3149,"相":1319,"省":-1052,"県":-4003,"研":-997,"社":-278,"空":-813,"統":1955,"者":-2233,"表":663,"語":-1073,"議":1219,"選":-1018,"郎":-368,"長":786,"間":1191,"題":2368,"館":-689,"1":-514,"E2":-32768,"「":363,"イ":241,"ル":451,"ン":-343};
|
||||||
|
this.UW6__ = {",":227,".":808,"1":-270,"E1":306,"、":227,"。":808,"あ":-307,"う":189,"か":241,"が":-73,"く":-121,"こ":-200,"じ":1782,"す":383,"た":-428,"っ":573,"て":-1014,"で":101,"と":-105,"な":-253,"に":-149,"の":-417,"は":-236,"も":-206,"り":187,"る":-135,"を":195,"ル":-673,"ン":-496,"一":-277,"中":201,"件":-800,"会":624,"前":302,"区":1792,"員":-1212,"委":798,"学":-960,"市":887,"広":-695,"後":535,"業":-697,"相":753,"社":-507,"福":974,"空":-822,"者":1811,"連":463,"郎":1082,"1":-270,"E1":306,"ル":-673,"ン":-496};
|
||||||
|
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
TinySegmenter.prototype.ctype_ = function(str) {
|
||||||
|
for (var i in this.chartype_) {
|
||||||
|
if (str.match(this.chartype_[i][0])) {
|
||||||
|
return this.chartype_[i][1];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return "O";
|
||||||
|
}
|
||||||
|
|
||||||
|
TinySegmenter.prototype.ts_ = function(v) {
|
||||||
|
if (v) { return v; }
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
TinySegmenter.prototype.segment = function(input) {
|
||||||
|
if (input == null || input == undefined || input == "") {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
var result = [];
|
||||||
|
var seg = ["B3","B2","B1"];
|
||||||
|
var ctype = ["O","O","O"];
|
||||||
|
var o = input.split("");
|
||||||
|
for (i = 0; i < o.length; ++i) {
|
||||||
|
seg.push(o[i]);
|
||||||
|
ctype.push(this.ctype_(o[i]))
|
||||||
|
}
|
||||||
|
seg.push("E1");
|
||||||
|
seg.push("E2");
|
||||||
|
seg.push("E3");
|
||||||
|
ctype.push("O");
|
||||||
|
ctype.push("O");
|
||||||
|
ctype.push("O");
|
||||||
|
var word = seg[3];
|
||||||
|
var p1 = "U";
|
||||||
|
var p2 = "U";
|
||||||
|
var p3 = "U";
|
||||||
|
for (var i = 4; i < seg.length - 3; ++i) {
|
||||||
|
var score = this.BIAS__;
|
||||||
|
var w1 = seg[i-3];
|
||||||
|
var w2 = seg[i-2];
|
||||||
|
var w3 = seg[i-1];
|
||||||
|
var w4 = seg[i];
|
||||||
|
var w5 = seg[i+1];
|
||||||
|
var w6 = seg[i+2];
|
||||||
|
var c1 = ctype[i-3];
|
||||||
|
var c2 = ctype[i-2];
|
||||||
|
var c3 = ctype[i-1];
|
||||||
|
var c4 = ctype[i];
|
||||||
|
var c5 = ctype[i+1];
|
||||||
|
var c6 = ctype[i+2];
|
||||||
|
score += this.ts_(this.UP1__[p1]);
|
||||||
|
score += this.ts_(this.UP2__[p2]);
|
||||||
|
score += this.ts_(this.UP3__[p3]);
|
||||||
|
score += this.ts_(this.BP1__[p1 + p2]);
|
||||||
|
score += this.ts_(this.BP2__[p2 + p3]);
|
||||||
|
score += this.ts_(this.UW1__[w1]);
|
||||||
|
score += this.ts_(this.UW2__[w2]);
|
||||||
|
score += this.ts_(this.UW3__[w3]);
|
||||||
|
score += this.ts_(this.UW4__[w4]);
|
||||||
|
score += this.ts_(this.UW5__[w5]);
|
||||||
|
score += this.ts_(this.UW6__[w6]);
|
||||||
|
score += this.ts_(this.BW1__[w2 + w3]);
|
||||||
|
score += this.ts_(this.BW2__[w3 + w4]);
|
||||||
|
score += this.ts_(this.BW3__[w4 + w5]);
|
||||||
|
score += this.ts_(this.TW1__[w1 + w2 + w3]);
|
||||||
|
score += this.ts_(this.TW2__[w2 + w3 + w4]);
|
||||||
|
score += this.ts_(this.TW3__[w3 + w4 + w5]);
|
||||||
|
score += this.ts_(this.TW4__[w4 + w5 + w6]);
|
||||||
|
score += this.ts_(this.UC1__[c1]);
|
||||||
|
score += this.ts_(this.UC2__[c2]);
|
||||||
|
score += this.ts_(this.UC3__[c3]);
|
||||||
|
score += this.ts_(this.UC4__[c4]);
|
||||||
|
score += this.ts_(this.UC5__[c5]);
|
||||||
|
score += this.ts_(this.UC6__[c6]);
|
||||||
|
score += this.ts_(this.BC1__[c2 + c3]);
|
||||||
|
score += this.ts_(this.BC2__[c3 + c4]);
|
||||||
|
score += this.ts_(this.BC3__[c4 + c5]);
|
||||||
|
score += this.ts_(this.TC1__[c1 + c2 + c3]);
|
||||||
|
score += this.ts_(this.TC2__[c2 + c3 + c4]);
|
||||||
|
score += this.ts_(this.TC3__[c3 + c4 + c5]);
|
||||||
|
score += this.ts_(this.TC4__[c4 + c5 + c6]);
|
||||||
|
// score += this.ts_(this.TC5__[c4 + c5 + c6]);
|
||||||
|
score += this.ts_(this.UQ1__[p1 + c1]);
|
||||||
|
score += this.ts_(this.UQ2__[p2 + c2]);
|
||||||
|
score += this.ts_(this.UQ3__[p3 + c3]);
|
||||||
|
score += this.ts_(this.BQ1__[p2 + c2 + c3]);
|
||||||
|
score += this.ts_(this.BQ2__[p2 + c3 + c4]);
|
||||||
|
score += this.ts_(this.BQ3__[p3 + c2 + c3]);
|
||||||
|
score += this.ts_(this.BQ4__[p3 + c3 + c4]);
|
||||||
|
score += this.ts_(this.TQ1__[p2 + c1 + c2 + c3]);
|
||||||
|
score += this.ts_(this.TQ2__[p2 + c2 + c3 + c4]);
|
||||||
|
score += this.ts_(this.TQ3__[p3 + c1 + c2 + c3]);
|
||||||
|
score += this.ts_(this.TQ4__[p3 + c2 + c3 + c4]);
|
||||||
|
var p = "O";
|
||||||
|
if (score > 0) {
|
||||||
|
result.push(word);
|
||||||
|
word = "";
|
||||||
|
p = "B";
|
||||||
|
}
|
||||||
|
p1 = p2;
|
||||||
|
p2 = p3;
|
||||||
|
p3 = p;
|
||||||
|
word += seg[i];
|
||||||
|
}
|
||||||
|
result.push(word);
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
lunr.TinySegmenter = TinySegmenter;
|
||||||
|
};
|
||||||
|
|
||||||
|
}));
|
||||||
6708
assets/javascripts/lunr/wordcut.js
Normal file
48
assets/javascripts/workers/search.16e2a7d4.min.js
vendored
Normal file
8
assets/javascripts/workers/search.16e2a7d4.min.js.map
Normal file
1
assets/stylesheets/main.20d9efc8.min.css
vendored
Normal file
1
assets/stylesheets/main.20d9efc8.min.css.map
Normal file
1
assets/stylesheets/palette.815d1a91.min.css
vendored
Normal file
1
assets/stylesheets/palette.815d1a91.min.css.map
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
{"version":3,"sources":["src/assets/stylesheets/palette/_scheme.scss","../../../src/assets/stylesheets/palette.scss","src/assets/stylesheets/palette/_accent.scss","src/assets/stylesheets/palette/_primary.scss","src/assets/stylesheets/utilities/_break.scss"],"names":[],"mappings":"AA2BA,cAGE,6BAKE,YAAA,CAGA,mDAAA,CACA,6DAAA,CACA,+DAAA,CACA,gEAAA,CACA,mDAAA,CACA,6DAAA,CACA,+DAAA,CACA,gEAAA,CAGA,gDAAA,CACA,gDAAA,CAGA,uCAAA,CACA,iCAAA,CACA,kCAAA,CACA,mCAAA,CACA,mCAAA,CACA,kCAAA,CACA,iCAAA,CACA,+CAAA,CACA,6DAAA,CACA,gEAAA,CACA,4DAAA,CACA,4DAAA,CACA,6DAAA,CAGA,6CAAA,CAGA,+CAAA,CAGA,2CAAA,CAGA,uDAAA,CACA,6DAAA,CACA,2DAAA,CAGA,yDAAA,CAGA,mDAAA,CACA,mDAAA,CAGA,qDAAA,CACA,wDAAA,CAGA,wEAAA,CAKA,yEAAA,CAKA,yECxDF,CD6DE,kHAEE,YC3DJ,CD+DE,gHAEE,eC7DJ,CDkFE,yDACE,4BChFJ,CD+EE,2DACE,4BC7EJ,CD4EE,gEACE,4BC1EJ,CDyEE,2DACE,4BCvEJ,CDsEE,yDACE,4BCpEJ,CDmEE,0DACE,4BCjEJ,CDgEE,gEACE,4BC9DJ,CD6DE,0DACE,4BC3DJ,CD0DE,uHACE,4BCrDJ,CD4DA,+FAGE,iCC1DF,CACF,CC3CE,2BACE,4BAAA,CACA,oDAAA,CAOE,yBAAA,CACA,8CDuCN,CCjDE,4BACE,4BAAA,CACA,mDAAA,CAOE,yBAAA,CACA,8CD8CN,CCxDE,8BACE,4BAAA,CACA,qDAAA,CAOE,yBAAA,CACA,8CDqDN,CC/DE,mCACE,4BAAA,CACA,qDAAA,CAOE,yBAAA,CACA,8CD4DN,CCtEE,8BACE,4BAAA,CACA,qDAAA,CAOE,yBAAA,CACA,8CDmEN,CC7EE,4BACE,4BAAA,CACA,qDAAA,CAOE,yBAAA,CACA,8CD0EN,CCpFE,kCACE,4BAAA,CACA,oDAAA,CAOE,yBAAA,CACA,8CDiFN,CC3FE,4BACE,4BAAA,CACA,oDAAA,CAOE,yBAAA,CACA,8CDwFN,CClGE,4BACE,4BAAA,CACA,oDAAA,CAOE,yBAAA,CACA,8CD+FN,CCzGE,6BACE,4BAAA,CACA,mDAAA,CAOE,yBAAA,CACA,8CDsGN,CChHE,mCACE,4BAAA,CACA,oDAAA,CAOE,yBAAA,CACA,8CD6GN,CCvHE,4BACE,4BAAA,CACA,oDAAA,CAIE,oCAAA,CACA,2CDuHN,CC9HE,8BACE,4BAAA,CACA,oDAAA,CAIE,oCAAA,CACA,2CD8HN,CCrIE,6BACE,yBAAA,CACA,oDAAA,CAIE,oCAAA,CACA,2CDqIN,CC5IE,8BACE,4BAAA,CACA,oDAAA,CAIE,oCAAA,CACA,2CD4IN,CCnJE,mCACE,4BAAA,CACA,qDAAA,CAOE,yBAAA,CACA,8CDgJN,CErJE,4BACE,6BAAA,CACA,oCAAA,CACA,mCAAA,CAOE,0BAAA,CACA,+CFkJN,CE7JE,6BACE,6BAAA,CACA,oCAAA,CACA,mCAAA,CAOE,0BAAA,CACA,+CF0JN,CErKE,+BACE,6BAAA,CACA,oCAAA,CACA,mCAAA,CAOE,0BAAA,CACA,+CFkKN,CE7KE,oCACE,6BAAA,CACA,oCAAA,CACA,mCAAA,CAOE,0BAAA,CACA,+CF0KN,CErLE,+BACE,6BAAA,CACA,oCAAA,CACA,mCAAA,CAOE,0BAAA,CACA,+CFkLN,CE7LE,6BACE,6BAAA,CACA,oCAAA,CACA,mCAAA,CAOE,0BAAA,CACA,+CF0LN,CErME,mCACE,6BAAA,CACA,oCAAA,CACA,mCAAA,CAOE,0BAAA,CACA,+CFkMN,CE7ME,6BACE,6BAAA,CACA,oCAAA,CACA,mCAAA,CAOE,0BAAA,CACA,+CF0MN,CErNE,6BACE,6BAAA,CACA,oCAAA,CACA,mCAAA,CAOE,0BAAA,CACA,+CFkNN,CE7NE,8BACE,6BAAA,CACA,oCAAA,CACA,mCAAA,CAOE,0BAAA,CACA,+CF0NN,CErOE,oCACE,6BAAA,CACA,oCAAA,CACA,mCAAA,CAOE,0BAAA,CACA,+CFkON,CE7OE,6BACE,6BAAA,CACA,oCAAA,CACA,mCAAA,CAIE,qCAAA,CACA,4CF6ON,CErPE,+BACE,6BAAA,CACA,oCAAA,CACA,mCAAA,CAIE,qCAAA,CACA,4CFqPN,CE7PE,8BACE,6BAAA,CACA,oCAAA,CACA,mCAAA,CAIE,qCAAA,CACA,4CF6PN,CErQE,+BACE,6BAAA,CACA,oCAAA,CACA,mCAAA,CAIE,qCAAA,CACA,4CFqQN,CE7QE,oCACE,6BAAA,CACA,oCAAA,CACA,mCAAA,CAOE,0BAAA,CACA,+CF0QN,CErRE,8BACE,6BAAA,CACA,oCAAA,CACA,mCAAA,CAOE,0BAAA,CACA,+CFkRN,CE7RE,6BACE,6BAAA,CACA,oCAAA,CACA,mCAAA,CAOE,0BAAA,CACA,+CAAA,CAKA,4BFsRN,CEtSE,kCACE,6BAAA,CACA,oCAAA,CACA,mCAAA,CAOE,0BAAA,CACA,+CAAA,CAKA,4BF+RN,CEhRE,sEACE,4BFmRJ,CEpRE,+DACE,4BFuRJ,CExRE,iEACE,4BF2RJ,CE5RE,gEACE,4BF+RJ,CEhSE,iEACE,4BFmSJ,CE1RA,8BACE,0BAAA,CACA,+CAAA,CACA,2CAAA,CACA,qCAAA,CACA,4CAAA,CAGA,4BF2RF,CExRE,yCACE,+BF0RJ,CEvRI,kDAEE,0CAAA,CACA,sCAAA,CAFA,UF2RN,CGvMI,mCD1EA,+CACE,gCFoRJ,CEjRI,qDACE,gCFmRN,CE9QE,iEACE,qBFgRJ,CACF,CGlNI,sCDvDA,uCACE,0CF4QJ,CACF,CEnQA,8BACE,0BAAA,CACA,4CAAA,CACA,gCAAA,CACA,0BAAA,CACA,+CAAA,CAGA,4BFoQF,CEjQE,yCACE,+BFmQJ,CEhQI,kDAEE,0CAAA,CACA,sCAAA,CAFA,UFoQN,CE7PE,yCACE,qBF+PJ,CGxNI,wCDhCA,8CACE,gCF2PJ,CACF,CGhPI,mCDJA,+CACE,oCFuPJ,CEpPI,qDACE,mCFsPN,CACF,CGrOI,wCDTA,iFACE,qBFiPJ,CACF,CG7PI,sCDmBA,uCACE,qBF6OJ,CACF","file":"palette.css"}
|
||||||
|
Before Width: | Height: | Size: 49 KiB |
1115
examples/scibert/additional-files/index.html
Normal file
2632
examples/scibert/data/index.html
Normal file
2599
examples/scibert/deploy/index.html
Normal file
1149
examples/scibert/index.html
Normal file
2551
examples/scibert/train/index.html
Normal file
|
Before Width: | Height: | Size: 1.5 MiB After Width: | Height: | Size: 1.5 MiB |
|
Before Width: | Height: | Size: 208 KiB After Width: | Height: | Size: 208 KiB |
2986
examples/simple-mag/train/index.html
Normal file
2537
examples/simple/data/index.html
Normal file
2471
examples/simple/deploy/index.html
Normal file
|
Before Width: | Height: | Size: 2.7 MiB After Width: | Height: | Size: 2.7 MiB |
|
Before Width: | Height: | Size: 792 KiB After Width: | Height: | Size: 792 KiB |
2144
examples/simple/stacked-bars/index.html
Normal file
3076
examples/simple/train/index.html
Normal file
950
explanation/index.html
Normal file
|
|
@ -0,0 +1,950 @@
|
||||||
|
|
||||||
|
<!doctype html>
|
||||||
|
<html lang="en" class="no-js">
|
||||||
|
<head>
|
||||||
|
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||||
|
|
||||||
|
<meta name="description" content="GreatAI helps you easily transform your prototype AI code into production-ready software.">
|
||||||
|
|
||||||
|
|
||||||
|
<meta name="author" content="András Schmelczer">
|
||||||
|
|
||||||
|
|
||||||
|
<link rel="icon" href="../media/favicon.ico">
|
||||||
|
<meta name="generator" content="mkdocs-1.4.2, mkdocs-material-8.5.8">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<title>Explanation - GreatAI documentation</title>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<link rel="stylesheet" href="../assets/stylesheets/main.20d9efc8.min.css">
|
||||||
|
|
||||||
|
|
||||||
|
<link rel="stylesheet" href="../assets/stylesheets/palette.815d1a91.min.css">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||||
|
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,300i,400,400i,700,700i%7CRoboto+Mono:400,400i,700,700i&display=fallback">
|
||||||
|
<style>:root{--md-text-font:"Roboto";--md-code-font:"Roboto Mono"}</style>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<link rel="stylesheet" href="../assets/_mkdocstrings.css">
|
||||||
|
|
||||||
|
<script>__md_scope=new URL("..",location),__md_hash=e=>[...e].reduce((e,_)=>(e<<5)-e+_.charCodeAt(0),0),__md_get=(e,_=localStorage,t=__md_scope)=>JSON.parse(_.getItem(t.pathname+"."+e)),__md_set=(e,_,t=localStorage,a=__md_scope)=>{try{t.setItem(a.pathname+"."+e,JSON.stringify(_))}catch(e){}}</script>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<meta property="og:title" content="">
|
||||||
|
<meta property="og:site_name" content="">
|
||||||
|
<meta property="og:url" content="">
|
||||||
|
<meta property="og:description" content="Transform your prototype AI code into production-ready software.">
|
||||||
|
<meta property="og:type" content="">
|
||||||
|
<meta property="og:image" content=https://great-ai.scoutinscience.com/media/og-image.png>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
.jupyter-wrapper a {
|
||||||
|
color: var(--md-typeset-a-color) !important;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
|
</head>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<body dir="ltr" data-md-color-scheme="default" data-md-color-primary="light-blue" data-md-color-accent="">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<script>var palette=__md_get("__palette");if(palette&&"object"==typeof palette.color)for(var key of Object.keys(palette.color))document.body.setAttribute("data-md-color-"+key,palette.color[key])</script>
|
||||||
|
|
||||||
|
<input class="md-toggle" data-md-toggle="drawer" type="checkbox" id="__drawer" autocomplete="off">
|
||||||
|
<input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
|
||||||
|
<label class="md-overlay" for="__drawer"></label>
|
||||||
|
<div data-md-component="skip">
|
||||||
|
|
||||||
|
|
||||||
|
<a href="#explanation" class="md-skip">
|
||||||
|
Skip to content
|
||||||
|
</a>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div data-md-component="announce">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<header class="md-header" data-md-component="header">
|
||||||
|
<nav class="md-header__inner md-grid" aria-label="Header">
|
||||||
|
<a href=".." title="GreatAI documentation" class="md-header__button md-logo" aria-label="GreatAI documentation" data-md-component="logo">
|
||||||
|
|
||||||
|
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 8a3 3 0 0 0 3-3 3 3 0 0 0-3-3 3 3 0 0 0-3 3 3 3 0 0 0 3 3m0 3.54C9.64 9.35 6.5 8 3 8v11c3.5 0 6.64 1.35 9 3.54 2.36-2.19 5.5-3.54 9-3.54V8c-3.5 0-6.64 1.35-9 3.54Z"/></svg>
|
||||||
|
|
||||||
|
</a>
|
||||||
|
<label class="md-header__button md-icon" for="__drawer">
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3 6h18v2H3V6m0 5h18v2H3v-2m0 5h18v2H3v-2Z"/></svg>
|
||||||
|
</label>
|
||||||
|
<div class="md-header__title" data-md-component="header-title">
|
||||||
|
<div class="md-header__ellipsis">
|
||||||
|
<div class="md-header__topic">
|
||||||
|
<span class="md-ellipsis">
|
||||||
|
GreatAI documentation
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<div class="md-header__topic" data-md-component="header-topic">
|
||||||
|
<span class="md-ellipsis">
|
||||||
|
|
||||||
|
Explanation
|
||||||
|
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<form class="md-header__option" data-md-component="palette">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<input class="md-option" data-md-color-media="(prefers-color-scheme: light)" data-md-color-scheme="default" data-md-color-primary="light-blue" data-md-color-accent="" aria-label="Switch to dark mode" type="radio" name="__palette" id="__palette_1">
|
||||||
|
|
||||||
|
<label class="md-header__button md-icon" title="Switch to dark mode" for="__palette_2" hidden>
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 2a7 7 0 0 0-7 7c0 2.38 1.19 4.47 3 5.74V17a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1v-2.26c1.81-1.27 3-3.36 3-5.74a7 7 0 0 0-7-7M9 21a1 1 0 0 0 1 1h4a1 1 0 0 0 1-1v-1H9v1Z"/></svg>
|
||||||
|
</label>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<input class="md-option" data-md-color-media="(prefers-color-scheme: dark)" data-md-color-scheme="slate" data-md-color-primary="light-blue" data-md-color-accent="" aria-label="Switch to light mode" type="radio" name="__palette" id="__palette_2">
|
||||||
|
|
||||||
|
<label class="md-header__button md-icon" title="Switch to light mode" for="__palette_1" hidden>
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 2a7 7 0 0 1 7 7c0 2.38-1.19 4.47-3 5.74V17a1 1 0 0 1-1 1H9a1 1 0 0 1-1-1v-2.26C6.19 13.47 5 11.38 5 9a7 7 0 0 1 7-7M9 21v-1h6v1a1 1 0 0 1-1 1h-4a1 1 0 0 1-1-1m3-17a5 5 0 0 0-5 5c0 2.05 1.23 3.81 3 4.58V16h4v-2.42c1.77-.77 3-2.53 3-4.58a5 5 0 0 0-5-5Z"/></svg>
|
||||||
|
</label>
|
||||||
|
|
||||||
|
|
||||||
|
</form>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<label class="md-header__button md-icon" for="__search">
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9.5 3A6.5 6.5 0 0 1 16 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.516 6.516 0 0 1 9.5 16 6.5 6.5 0 0 1 3 9.5 6.5 6.5 0 0 1 9.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 5Z"/></svg>
|
||||||
|
</label>
|
||||||
|
<div class="md-search" data-md-component="search" role="dialog">
|
||||||
|
<label class="md-search__overlay" for="__search"></label>
|
||||||
|
<div class="md-search__inner" role="search">
|
||||||
|
<form class="md-search__form" name="search">
|
||||||
|
<input type="text" class="md-search__input" name="query" aria-label="Search" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="search-query" required>
|
||||||
|
<label class="md-search__icon md-icon" for="__search">
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9.5 3A6.5 6.5 0 0 1 16 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.516 6.516 0 0 1 9.5 16 6.5 6.5 0 0 1 3 9.5 6.5 6.5 0 0 1 9.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 5Z"/></svg>
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11h12Z"/></svg>
|
||||||
|
</label>
|
||||||
|
<nav class="md-search__options" aria-label="Search">
|
||||||
|
|
||||||
|
<button type="reset" class="md-search__icon md-icon" title="Clear" aria-label="Clear" tabindex="-1">
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41Z"/></svg>
|
||||||
|
</button>
|
||||||
|
</nav>
|
||||||
|
|
||||||
|
</form>
|
||||||
|
<div class="md-search__output">
|
||||||
|
<div class="md-search__scrollwrap" data-md-scrollfix>
|
||||||
|
<div class="md-search-result" data-md-component="search-result">
|
||||||
|
<div class="md-search-result__meta">
|
||||||
|
Initializing search
|
||||||
|
</div>
|
||||||
|
<ol class="md-search-result__list"></ol>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="md-header__source">
|
||||||
|
<a href="https://github.com/schmelczer/great-ai" title="Go to repository" class="md-source" data-md-component="source">
|
||||||
|
<div class="md-source__icon md-icon">
|
||||||
|
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--! Font Awesome Free 6.2.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2022 Fonticons, Inc.--><path d="M439.55 236.05 244 40.45a28.87 28.87 0 0 0-40.81 0l-40.66 40.63 51.52 51.52c27.06-9.14 52.68 16.77 43.39 43.68l49.66 49.66c34.23-11.8 61.18 31 35.47 56.69-26.49 26.49-70.21-2.87-56-37.34L240.22 199v121.85c25.3 12.54 22.26 41.85 9.08 55a34.34 34.34 0 0 1-48.55 0c-17.57-17.6-11.07-46.91 11.25-56v-123c-20.8-8.51-24.6-30.74-18.64-45L142.57 101 8.45 235.14a28.86 28.86 0 0 0 0 40.81l195.61 195.6a28.86 28.86 0 0 0 40.8 0l194.69-194.69a28.86 28.86 0 0 0 0-40.81z"/></svg>
|
||||||
|
</div>
|
||||||
|
<div class="md-source__repository">
|
||||||
|
schmelczer/great-ai
|
||||||
|
</div>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</nav>
|
||||||
|
|
||||||
|
</header>
|
||||||
|
|
||||||
|
<div class="md-container" data-md-component="container">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<main class="md-main" data-md-component="main">
|
||||||
|
<div class="md-main__inner md-grid">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<div class="md-sidebar md-sidebar--primary" data-md-component="sidebar" data-md-type="navigation" >
|
||||||
|
<div class="md-sidebar__scrollwrap">
|
||||||
|
<div class="md-sidebar__inner">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<nav class="md-nav md-nav--primary" aria-label="Navigation" data-md-level="0">
|
||||||
|
<label class="md-nav__title" for="__drawer">
|
||||||
|
<a href=".." title="GreatAI documentation" class="md-nav__button md-logo" aria-label="GreatAI documentation" data-md-component="logo">
|
||||||
|
|
||||||
|
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 8a3 3 0 0 0 3-3 3 3 0 0 0-3-3 3 3 0 0 0-3 3 3 3 0 0 0 3 3m0 3.54C9.64 9.35 6.5 8 3 8v11c3.5 0 6.64 1.35 9 3.54 2.36-2.19 5.5-3.54 9-3.54V8c-3.5 0-6.64 1.35-9 3.54Z"/></svg>
|
||||||
|
|
||||||
|
</a>
|
||||||
|
GreatAI documentation
|
||||||
|
</label>
|
||||||
|
|
||||||
|
<div class="md-nav__source">
|
||||||
|
<a href="https://github.com/schmelczer/great-ai" title="Go to repository" class="md-source" data-md-component="source">
|
||||||
|
<div class="md-source__icon md-icon">
|
||||||
|
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--! Font Awesome Free 6.2.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2022 Fonticons, Inc.--><path d="M439.55 236.05 244 40.45a28.87 28.87 0 0 0-40.81 0l-40.66 40.63 51.52 51.52c27.06-9.14 52.68 16.77 43.39 43.68l49.66 49.66c34.23-11.8 61.18 31 35.47 56.69-26.49 26.49-70.21-2.87-56-37.34L240.22 199v121.85c25.3 12.54 22.26 41.85 9.08 55a34.34 34.34 0 0 1-48.55 0c-17.57-17.6-11.07-46.91 11.25-56v-123c-20.8-8.51-24.6-30.74-18.64-45L142.57 101 8.45 235.14a28.86 28.86 0 0 0 0 40.81l195.61 195.6a28.86 28.86 0 0 0 40.8 0l194.69-194.69a28.86 28.86 0 0 0 0-40.81z"/></svg>
|
||||||
|
</div>
|
||||||
|
<div class="md-source__repository">
|
||||||
|
schmelczer/great-ai
|
||||||
|
</div>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<ul class="md-nav__list" data-md-scrollfix>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href=".." class="md-nav__link">
|
||||||
|
Overview
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<li class="md-nav__item md-nav__item--nested">
|
||||||
|
|
||||||
|
|
||||||
|
<input class="md-nav__toggle md-toggle" data-md-toggle="__nav_2" type="checkbox" id="__nav_2" >
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<label class="md-nav__link" for="__nav_2">
|
||||||
|
Tutorial
|
||||||
|
<span class="md-nav__icon md-icon"></span>
|
||||||
|
</label>
|
||||||
|
|
||||||
|
<nav class="md-nav" aria-label="Tutorial" data-md-level="1">
|
||||||
|
<label class="md-nav__title" for="__nav_2">
|
||||||
|
<span class="md-nav__icon md-icon"></span>
|
||||||
|
Tutorial
|
||||||
|
</label>
|
||||||
|
<ul class="md-nav__list" data-md-scrollfix>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="../tutorial/" class="md-nav__link">
|
||||||
|
Tutorial overview
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="../tutorial/train/" class="md-nav__link">
|
||||||
|
Train your model
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="../tutorial/deploy/" class="md-nav__link">
|
||||||
|
Harden and deploy your app
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</ul>
|
||||||
|
</nav>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<li class="md-nav__item md-nav__item--nested">
|
||||||
|
|
||||||
|
|
||||||
|
<input class="md-nav__toggle md-toggle" data-md-toggle="__nav_3" type="checkbox" id="__nav_3" >
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<label class="md-nav__link" for="__nav_3">
|
||||||
|
User Guides
|
||||||
|
<span class="md-nav__icon md-icon"></span>
|
||||||
|
</label>
|
||||||
|
|
||||||
|
<nav class="md-nav" aria-label="User Guides" data-md-level="1">
|
||||||
|
<label class="md-nav__title" for="__nav_3">
|
||||||
|
<span class="md-nav__icon md-icon"></span>
|
||||||
|
User Guides
|
||||||
|
</label>
|
||||||
|
<ul class="md-nav__list" data-md-scrollfix>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="../how-to-guides/install/" class="md-nav__link">
|
||||||
|
Installation guide
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="../how-to-guides/create-service/" class="md-nav__link">
|
||||||
|
How to create a GreatAI service
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="../how-to-guides/configure-service/" class="md-nav__link">
|
||||||
|
How to configure GreatAI
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="../how-to-guides/use-service/" class="md-nav__link">
|
||||||
|
How to perform prediction with GreatAI
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="../how-to-guides/handle-training-data/" class="md-nav__link">
|
||||||
|
How to manage training data
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="../how-to-guides/large-file/" class="md-nav__link">
|
||||||
|
How to use LargeFiles
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="../how-to-guides/call-remote/" class="md-nav__link">
|
||||||
|
How to call remote GreatAI instances
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</ul>
|
||||||
|
</nav>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<li class="md-nav__item md-nav__item--nested">
|
||||||
|
|
||||||
|
|
||||||
|
<input class="md-nav__toggle md-toggle" data-md-toggle="__nav_4" type="checkbox" id="__nav_4" >
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<label class="md-nav__link" for="__nav_4">
|
||||||
|
Reference
|
||||||
|
<span class="md-nav__icon md-icon"></span>
|
||||||
|
</label>
|
||||||
|
|
||||||
|
<nav class="md-nav" aria-label="Reference" data-md-level="1">
|
||||||
|
<label class="md-nav__title" for="__nav_4">
|
||||||
|
<span class="md-nav__icon md-icon"></span>
|
||||||
|
Reference
|
||||||
|
</label>
|
||||||
|
<ul class="md-nav__list" data-md-scrollfix>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="../reference/" class="md-nav__link">
|
||||||
|
GreatAI reference
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="../reference/utilities/" class="md-nav__link">
|
||||||
|
Utilities
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="../reference/large-file/" class="md-nav__link">
|
||||||
|
LargeFile
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="../reference/views/" class="md-nav__link">
|
||||||
|
View models
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</ul>
|
||||||
|
</nav>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<li class="md-nav__item md-nav__item--nested">
|
||||||
|
|
||||||
|
|
||||||
|
<input class="md-nav__toggle md-toggle" data-md-toggle="__nav_5" type="checkbox" id="__nav_5" >
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<label class="md-nav__link" for="__nav_5">
|
||||||
|
Examples
|
||||||
|
<span class="md-nav__icon md-icon"></span>
|
||||||
|
</label>
|
||||||
|
|
||||||
|
<nav class="md-nav" aria-label="Examples" data-md-level="1">
|
||||||
|
<label class="md-nav__title" for="__nav_5">
|
||||||
|
<span class="md-nav__icon md-icon"></span>
|
||||||
|
Examples
|
||||||
|
</label>
|
||||||
|
<ul class="md-nav__list" data-md-scrollfix>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<li class="md-nav__item md-nav__item--nested">
|
||||||
|
|
||||||
|
|
||||||
|
<input class="md-nav__toggle md-toggle" data-md-toggle="__nav_5_1" type="checkbox" id="__nav_5_1" >
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<label class="md-nav__link" for="__nav_5_1">
|
||||||
|
Explainable Naive Bayes
|
||||||
|
<span class="md-nav__icon md-icon"></span>
|
||||||
|
</label>
|
||||||
|
|
||||||
|
<nav class="md-nav" aria-label="Explainable Naive Bayes" data-md-level="2">
|
||||||
|
<label class="md-nav__title" for="__nav_5_1">
|
||||||
|
<span class="md-nav__icon md-icon"></span>
|
||||||
|
Explainable Naive Bayes
|
||||||
|
</label>
|
||||||
|
<ul class="md-nav__list" data-md-scrollfix>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="../examples/simple/data/" class="md-nav__link">
|
||||||
|
Simple example: data engineering
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="../examples/simple/train/" class="md-nav__link">
|
||||||
|
Optimise and train a model
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="../examples/simple/deploy/" class="md-nav__link">
|
||||||
|
Hardening and deployment
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</ul>
|
||||||
|
</nav>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<li class="md-nav__item md-nav__item--nested">
|
||||||
|
|
||||||
|
|
||||||
|
<input class="md-nav__toggle md-toggle" data-md-toggle="__nav_5_2" type="checkbox" id="__nav_5_2" >
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<label class="md-nav__link" for="__nav_5_2">
|
||||||
|
Explainable SciBERT
|
||||||
|
<span class="md-nav__icon md-icon"></span>
|
||||||
|
</label>
|
||||||
|
|
||||||
|
<nav class="md-nav" aria-label="Explainable SciBERT" data-md-level="2">
|
||||||
|
<label class="md-nav__title" for="__nav_5_2">
|
||||||
|
<span class="md-nav__icon md-icon"></span>
|
||||||
|
Explainable SciBERT
|
||||||
|
</label>
|
||||||
|
<ul class="md-nav__list" data-md-scrollfix>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="../examples/scibert/" class="md-nav__link">
|
||||||
|
Summarising scientific publications from a tech-transfer perspective
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="../examples/scibert/data/" class="md-nav__link">
|
||||||
|
Explore data and feasibility of approach
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="../examples/scibert/train/" class="md-nav__link">
|
||||||
|
Fine-tune SciBERT
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="../examples/scibert/deploy/" class="md-nav__link">
|
||||||
|
Create an inference function
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<li class="md-nav__item">
|
||||||
|
<a href="../examples/scibert/additional-files/" class="md-nav__link">
|
||||||
|
Additional files in the repository
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</ul>
|
||||||
|
</nav>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</ul>
|
||||||
|
</nav>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<li class="md-nav__item md-nav__item--active">
|
||||||
|
|
||||||
|
<input class="md-nav__toggle md-toggle" data-md-toggle="toc" type="checkbox" id="__toc">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a href="./" class="md-nav__link md-nav__link--active">
|
||||||
|
Explanation
|
||||||
|
</a>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</ul>
|
||||||
|
</nav>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<div class="md-sidebar md-sidebar--secondary" data-md-component="sidebar" data-md-type="toc" >
|
||||||
|
<div class="md-sidebar__scrollwrap">
|
||||||
|
<div class="md-sidebar__inner">
|
||||||
|
|
||||||
|
|
||||||
|
<nav class="md-nav md-nav--secondary" aria-label="Table of contents">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</nav>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<div class="md-content" data-md-component="content">
|
||||||
|
<article class="md-content__inner md-typeset">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a href="https://github.com/schmelczer/great-ai/edit/main/docs/explanation.md" title="Edit this page" class="md-content__button md-icon">
|
||||||
|
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20.71 7.04c.39-.39.39-1.04 0-1.41l-2.34-2.34c-.37-.39-1.02-.39-1.41 0l-1.84 1.83 3.75 3.75M3 17.25V21h3.75L17.81 9.93l-3.75-3.75L3 17.25Z"/></svg>
|
||||||
|
</a>
|
||||||
|
|
||||||
|
|
||||||
|
<h1 id="explanation">Explanation<a class="headerlink" href="#explanation" title="Permanent link">#</a></h1>
|
||||||
|
<p>A lot more details and discussion about the problem context and approaches of GreatAI, along with its evaluation, can be found in my thesis.</p>
|
||||||
|
<div style="display: flex; justify-content: center;">
|
||||||
|
<img src="/media/thesis-frontpage.png" style="height: 500px;" alt="front page"/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div style="display: flex; justify-content: space-evenly;">
|
||||||
|
<p><a class="md-button md-button--primary" download="greatai_schmelczer.pdf" href="../thesis/main.pdf">:<span class="twemoji"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512"><!--! Font Awesome Free 6.2.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2022 Fonticons, Inc.--><path d="M320 32c-8.1 0-16.1 1.4-23.7 4.1L15.8 137.4C6.3 140.9 0 149.9 0 160s6.3 19.1 15.8 22.6l57.9 20.9C57.3 229.3 48 259.8 48 291.9V320c0 28.4-10.8 57.7-22.3 80.8-6.5 13-13.9 25.8-22.5 37.6-3.2 4.3-4.1 9.9-2.3 15s6 8.9 11.2 10.2l64 16c4.2 1.1 8.7.3 12.4-2s6.3-6.1 7.1-10.4c8.6-42.8 4.3-81.2-2.1-108.7-3.2-14.2-7.5-28.7-13.5-42v-24.6c0-30.2 10.2-58.7 27.9-81.5 12.9-15.5 29.6-28 49.2-35.7l157-61.7c8.2-3.2 17.5.8 20.7 9s-.8 17.5-9 20.7l-157 61.7c-12.4 4.9-23.3 12.4-32.2 21.6l159.6 57.6c7.6 2.7 15.6 4.1 23.7 4.1s16.1-1.4 23.7-4.1l280.6-101c9.5-3.4 15.8-12.5 15.8-22.6s-6.3-19.1-15.8-22.6L343.7 36.1c-7.6-2.7-15.6-4.1-23.7-4.1zM128 408c0 35.3 86 72 192 72s192-36.7 192-72l-15.3-145.4L354.5 314c-11.1 4-22.8 6-34.5 6s-23.5-2-34.5-6l-142.2-51.4L128 408z"/></svg></span> Download</a></p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<hr>
|
||||||
|
<div class="md-source-file">
|
||||||
|
<small>
|
||||||
|
|
||||||
|
Last update:
|
||||||
|
<span class="git-revision-date-localized-plugin git-revision-date-localized-plugin-date">August 20, 2022</span>
|
||||||
|
|
||||||
|
|
||||||
|
</small>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</article>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</main>
|
||||||
|
|
||||||
|
<footer class="md-footer">
|
||||||
|
|
||||||
|
|
||||||
|
<nav class="md-footer__inner md-grid" aria-label="Footer" >
|
||||||
|
|
||||||
|
|
||||||
|
<a href="../examples/scibert/additional-files/" class="md-footer__link md-footer__link--prev" aria-label="Previous: Additional files in the repository" rel="prev">
|
||||||
|
<div class="md-footer__button md-icon">
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11h12Z"/></svg>
|
||||||
|
</div>
|
||||||
|
<div class="md-footer__title">
|
||||||
|
<div class="md-ellipsis">
|
||||||
|
<span class="md-footer__direction">
|
||||||
|
Previous
|
||||||
|
</span>
|
||||||
|
Additional files in the repository
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</a>
|
||||||
|
|
||||||
|
|
||||||
|
</nav>
|
||||||
|
|
||||||
|
<div class="md-footer-meta md-typeset">
|
||||||
|
<div class="md-footer-meta__inner md-grid">
|
||||||
|
<div class="md-copyright">
|
||||||
|
|
||||||
|
<div class="md-copyright__highlight">
|
||||||
|
GNU General Public License v3
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="md-social">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a href="https://schmelczer.dev" target="_blank" rel="noopener" title="about the author" class="md-social__link">
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512"><!--! Font Awesome Free 6.2.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2022 Fonticons, Inc.--><path d="M392.8 1.2c-17-4.9-34.7 5-39.6 22l-128 448c-4.9 17 5 34.7 22 39.6s34.7-5 39.6-22l128-448c4.9-17-5-34.7-22-39.6zm80.6 120.1c-12.5 12.5-12.5 32.8 0 45.3l89.3 89.4-89.4 89.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l112-112c12.5-12.5 12.5-32.8 0-45.3l-112-112c-12.5-12.5-32.8-12.5-45.3 0zm-306.7 0c-12.5-12.5-32.8-12.5-45.3 0l-112 112c-12.5 12.5-12.5 32.8 0 45.3l112 112c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L77.3 256l89.4-89.4c12.5-12.5 12.5-32.8 0-45.3z"/></svg>
|
||||||
|
</a>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a href="https://github.com/schmelczer/great-ai" target="_blank" rel="noopener" title="great-ai on Github" class="md-social__link">
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 496 512"><!--! Font Awesome Free 6.2.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2022 Fonticons, Inc.--><path d="M165.9 397.4c0 2-2.3 3.6-5.2 3.6-3.3.3-5.6-1.3-5.6-3.6 0-2 2.3-3.6 5.2-3.6 3-.3 5.6 1.3 5.6 3.6zm-31.1-4.5c-.7 2 1.3 4.3 4.3 4.9 2.6 1 5.6 0 6.2-2s-1.3-4.3-4.3-5.2c-2.6-.7-5.5.3-6.2 2.3zm44.2-1.7c-2.9.7-4.9 2.6-4.6 4.9.3 2 2.9 3.3 5.9 2.6 2.9-.7 4.9-2.6 4.6-4.6-.3-1.9-3-3.2-5.9-2.9zM244.8 8C106.1 8 0 113.3 0 252c0 110.9 69.8 205.8 169.5 239.2 12.8 2.3 17.3-5.6 17.3-12.1 0-6.2-.3-40.4-.3-61.4 0 0-70 15-84.7-29.8 0 0-11.4-29.1-27.8-36.6 0 0-22.9-15.7 1.6-15.4 0 0 24.9 2 38.6 25.8 21.9 38.6 58.6 27.5 72.9 20.9 2.3-16 8.8-27.1 16-33.7-55.9-6.2-112.3-14.3-112.3-110.5 0-27.5 7.6-41.3 23.6-58.9-2.6-6.5-11.1-33.3 2.6-67.9 20.9-6.5 69 27 69 27 20-5.6 41.5-8.5 62.8-8.5s42.8 2.9 62.8 8.5c0 0 48.1-33.6 69-27 13.7 34.7 5.2 61.4 2.6 67.9 16 17.7 25.8 31.5 25.8 58.9 0 96.5-58.9 104.2-114.8 110.5 9.2 7.9 17 22.9 17 46.4 0 33.7-.3 75.4-.3 83.6 0 6.5 4.6 14.4 17.3 12.1C428.2 457.8 496 362.9 496 252 496 113.3 383.5 8 244.8 8zM97.2 352.9c-1.3 1-1 3.3.7 5.2 1.6 1.6 3.9 2.3 5.2 1 1.3-1 1-3.3-.7-5.2-1.6-1.6-3.9-2.3-5.2-1zm-10.8-8.1c-.7 1.3.3 2.9 2.3 3.9 1.6 1 3.6.7 4.3-.7.7-1.3-.3-2.9-2.3-3.9-2-.6-3.6-.3-4.3.7zm32.4 35.6c-1.6 1.3-1 4.3 1.3 6.2 2.3 2.3 5.2 2.6 6.5 1 1.3-1.3.7-4.3-1.3-6.2-2.2-2.3-5.2-2.6-6.5-1zm-11.4-14.7c-1.6 1-1.6 3.6 0 5.9 1.6 2.3 4.3 3.3 5.6 2.3 1.6-1.3 1.6-3.9 0-6.2-1.4-2.3-4-3.3-5.6-2z"/></svg>
|
||||||
|
</a>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a href="https://hub.docker.com/repository/docker/schmelczera/great-ai" target="_blank" rel="noopener" title="great-ai on DockerHub" class="md-social__link">
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512"><!--! Font Awesome Free 6.2.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2022 Fonticons, Inc.--><path d="M349.9 236.3h-66.1v-59.4h66.1v59.4zm0-204.3h-66.1v60.7h66.1V32zm78.2 144.8H362v59.4h66.1v-59.4zm-156.3-72.1h-66.1v60.1h66.1v-60.1zm78.1 0h-66.1v60.1h66.1v-60.1zm276.8 100c-14.4-9.7-47.6-13.2-73.1-8.4-3.3-24-16.7-44.9-41.1-63.7l-14-9.3-9.3 14c-18.4 27.8-23.4 73.6-3.7 103.8-8.7 4.7-25.8 11.1-48.4 10.7H2.4c-8.7 50.8 5.8 116.8 44 162.1 37.1 43.9 92.7 66.2 165.4 66.2 157.4 0 273.9-72.5 328.4-204.2 21.4.4 67.6.1 91.3-45.2 1.5-2.5 6.6-13.2 8.5-17.1l-13.3-8.9zm-511.1-27.9h-66v59.4h66.1v-59.4zm78.1 0h-66.1v59.4h66.1v-59.4zm78.1 0h-66.1v59.4h66.1v-59.4zm-78.1-72.1h-66.1v60.1h66.1v-60.1z"/></svg>
|
||||||
|
</a>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a href="https://pypi.org/project/great-ai" target="_blank" rel="noopener" title="great-ai on PyPI" class="md-social__link">
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--! Font Awesome Free 6.2.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2022 Fonticons, Inc.--><path d="M439.8 200.5c-7.7-30.9-22.3-54.2-53.4-54.2h-40.1v47.4c0 36.8-31.2 67.8-66.8 67.8H172.7c-29.2 0-53.4 25-53.4 54.3v101.8c0 29 25.2 46 53.4 54.3 33.8 9.9 66.3 11.7 106.8 0 26.9-7.8 53.4-23.5 53.4-54.3v-40.7H226.2v-13.6h160.2c31.1 0 42.6-21.7 53.4-54.2 11.2-33.5 10.7-65.7 0-108.6zM286.2 404c11.1 0 20.1 9.1 20.1 20.3 0 11.3-9 20.4-20.1 20.4-11 0-20.1-9.2-20.1-20.4.1-11.3 9.1-20.3 20.1-20.3zM167.8 248.1h106.8c29.7 0 53.4-24.5 53.4-54.3V91.9c0-29-24.4-50.7-53.4-55.6-35.8-5.9-74.7-5.6-106.8.1-45.2 8-53.4 24.7-53.4 55.6v40.7h106.9v13.6h-147c-31.1 0-58.3 18.7-66.8 54.2-9.8 40.7-10.2 66.1 0 108.6 7.6 31.6 25.7 54.2 56.8 54.2H101v-48.8c0-35.3 30.5-66.4 66.8-66.4zm-6.7-142.6c-11.1 0-20.1-9.1-20.1-20.3.1-11.3 9-20.4 20.1-20.4 11 0 20.1 9.2 20.1 20.4s-9 20.3-20.1 20.3z"/></svg>
|
||||||
|
</a>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</footer>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="md-dialog" data-md-component="dialog">
|
||||||
|
<div class="md-dialog__inner md-typeset"></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script id="__config" type="application/json">{"base": "..", "features": ["content.code.annotate", "content.tooltips"], "search": "../assets/javascripts/workers/search.16e2a7d4.min.js", "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.config.lang": "en", "search.config.pipeline": "trimmer, stopWordFilter", "search.config.separator": "[\\s\\-]+", "search.placeholder": "Search", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version.title": "Select version"}}</script>
|
||||||
|
|
||||||
|
|
||||||
|
<script src="../assets/javascripts/bundle.d6c3db9e.min.js"></script>
|
||||||
|
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
@ -1,32 +0,0 @@
|
||||||
"""Transform your prototype AI code into production-ready software."""
|
|
||||||
|
|
||||||
__version__ = "0.1.11"
|
|
||||||
|
|
||||||
|
|
||||||
from .context import configure
|
|
||||||
from .deploy import GreatAI
|
|
||||||
from .errors import (
|
|
||||||
ArgumentValidationError,
|
|
||||||
MissingArgumentError,
|
|
||||||
RemoteCallError,
|
|
||||||
WrongDecoratorOrderError,
|
|
||||||
)
|
|
||||||
from .models.save_model import save_model
|
|
||||||
from .models.use_model import use_model
|
|
||||||
from .parameters.log_metric import log_metric
|
|
||||||
from .parameters.parameter import parameter
|
|
||||||
from .persistence.mongodb_driver import MongoDbDriver
|
|
||||||
from .persistence.parallel_tinydb_driver import ParallelTinyDbDriver
|
|
||||||
from .persistence.tracing_database_driver import TracingDatabaseDriver
|
|
||||||
from .remote.call_remote_great_ai import call_remote_great_ai
|
|
||||||
from .remote.call_remote_great_ai_async import call_remote_great_ai_async
|
|
||||||
from .tracing.add_ground_truth import add_ground_truth
|
|
||||||
from .tracing.delete_ground_truth import delete_ground_truth
|
|
||||||
from .tracing.query_ground_truth import query_ground_truth
|
|
||||||
from .views import RouteConfig, Trace
|
|
||||||
from .views.outputs.classification_output import ClassificationOutput
|
|
||||||
from .views.outputs.multi_label_classification_output import (
|
|
||||||
MultiLabelClassificationOutput,
|
|
||||||
)
|
|
||||||
from .views.outputs.regression_output import RegressionOutput
|
|
||||||
from .views.outputs.sequence_labeling_output import SequenceLabelingOutput
|
|
||||||
|
|
@ -1,223 +0,0 @@
|
||||||
#!/usr/bin/env python3
|
|
||||||
|
|
||||||
import logging
|
|
||||||
import re
|
|
||||||
from importlib import import_module, reload
|
|
||||||
from pathlib import Path
|
|
||||||
from threading import Event
|
|
||||||
from typing import Optional
|
|
||||||
|
|
||||||
import uvicorn
|
|
||||||
from uvicorn._subprocess import get_subprocess
|
|
||||||
from uvicorn.config import LOGGING_CONFIG, Config
|
|
||||||
from uvicorn.supervisors import BaseReload, Multiprocess
|
|
||||||
from watchdog.events import FileSystemEvent, PatternMatchingEventHandler
|
|
||||||
from watchdog.observers import Observer
|
|
||||||
|
|
||||||
from great_ai.constants import SERVER_NAME
|
|
||||||
from great_ai.context import _is_in_production_mode
|
|
||||||
from great_ai.deploy import GreatAI
|
|
||||||
from great_ai.errors import ArgumentValidationError, MissingArgumentError
|
|
||||||
from great_ai.utilities import get_logger
|
|
||||||
|
|
||||||
from .parse_arguments import parse_arguments
|
|
||||||
|
|
||||||
logger = get_logger(SERVER_NAME)
|
|
||||||
|
|
||||||
|
|
||||||
GREAT_AI_LOGGING_CONFIG = {
|
|
||||||
**LOGGING_CONFIG,
|
|
||||||
"formatters": {
|
|
||||||
"default": {
|
|
||||||
"()": "great_ai.utilities.logger.get_logger.CustomFormatter",
|
|
||||||
"fmt": "%(asctime)s | %(levelname)8s | %(message)s",
|
|
||||||
},
|
|
||||||
"access": {
|
|
||||||
"()": "great_ai.utilities.logger.get_logger.CustomFormatter",
|
|
||||||
"fmt": "%(asctime)s | %(levelname)8s | %(message)s",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
def serve() -> None:
|
|
||||||
args = parse_arguments()
|
|
||||||
should_auto_reload = not _is_in_production_mode(logger=None)
|
|
||||||
|
|
||||||
if args.worker_count > 1 and should_auto_reload:
|
|
||||||
raise ArgumentValidationError(
|
|
||||||
"Cannot use auto-reload with multiple worker_count: set the `--worker_count=1` CLI argument,"
|
|
||||||
+ "or set the ENVIRONMENT environment variable to `production`."
|
|
||||||
)
|
|
||||||
|
|
||||||
common_config = dict(
|
|
||||||
host=args.host,
|
|
||||||
port=args.port,
|
|
||||||
timeout_keep_alive=args.timeout_keep_alive,
|
|
||||||
workers=args.worker_count,
|
|
||||||
server_header=False,
|
|
||||||
reload=False,
|
|
||||||
log_config=GREAT_AI_LOGGING_CONFIG,
|
|
||||||
)
|
|
||||||
|
|
||||||
if not should_auto_reload:
|
|
||||||
file_name = get_script_name(args.file_name)
|
|
||||||
app = find_app(file_name)
|
|
||||||
|
|
||||||
logger.info(f"Starting uvicorn server with app={app}")
|
|
||||||
|
|
||||||
config = Config(app, **common_config)
|
|
||||||
socket = config.bind_socket()
|
|
||||||
|
|
||||||
try:
|
|
||||||
Multiprocess(
|
|
||||||
config, target=uvicorn.Server(config=config).run, sockets=[socket]
|
|
||||||
).run()
|
|
||||||
|
|
||||||
finally:
|
|
||||||
if args.file_name.endswith(".ipynb"):
|
|
||||||
try:
|
|
||||||
Path(get_script_name_of_notebook(args.file_name)).unlink()
|
|
||||||
except FileNotFoundError:
|
|
||||||
# missing_ok only exists >= Python 3.8
|
|
||||||
pass
|
|
||||||
else:
|
|
||||||
|
|
||||||
class EventHandler(PatternMatchingEventHandler):
|
|
||||||
def __init__(self) -> None:
|
|
||||||
super().__init__(
|
|
||||||
patterns=["*.py", "*.ipynb"], ignore_patterns=["__*.py"]
|
|
||||||
)
|
|
||||||
self.server: Optional[GreatAIReload] = None
|
|
||||||
self.restart()
|
|
||||||
|
|
||||||
def on_closed(self, event: FileSystemEvent) -> None:
|
|
||||||
logger.warning(f"File {event.src_path} has triggered a restart")
|
|
||||||
self.restart()
|
|
||||||
|
|
||||||
def restart(self) -> None:
|
|
||||||
file_name = get_script_name(args.file_name)
|
|
||||||
app = find_app(file_name)
|
|
||||||
if app is None:
|
|
||||||
logger.warning("Auto-reloading skipped")
|
|
||||||
return
|
|
||||||
|
|
||||||
self.stop_server()
|
|
||||||
|
|
||||||
config = Config(app, **common_config)
|
|
||||||
socket = config.bind_socket()
|
|
||||||
self.server = GreatAIReload(
|
|
||||||
config, target=uvicorn.Server(config=config).run, sockets=[socket]
|
|
||||||
)
|
|
||||||
self.server.startup()
|
|
||||||
|
|
||||||
def stop_server(self) -> None:
|
|
||||||
if self.server:
|
|
||||||
self.server.shutdown()
|
|
||||||
|
|
||||||
restart_handler = EventHandler()
|
|
||||||
observer = Observer()
|
|
||||||
observer.schedule(restart_handler, path=".", recursive=True)
|
|
||||||
observer.start()
|
|
||||||
|
|
||||||
try:
|
|
||||||
Event().wait()
|
|
||||||
finally:
|
|
||||||
observer.stop()
|
|
||||||
restart_handler.stop_server()
|
|
||||||
if args.file_name.endswith(".ipynb"):
|
|
||||||
try:
|
|
||||||
Path(get_script_name_of_notebook(args.file_name)).unlink()
|
|
||||||
except FileNotFoundError:
|
|
||||||
# missing_ok only exists >= Python 3.8
|
|
||||||
pass
|
|
||||||
observer.join()
|
|
||||||
|
|
||||||
|
|
||||||
def get_script_name(file_name_argument: str) -> str:
|
|
||||||
if file_name_argument.endswith(".ipynb"):
|
|
||||||
logger.info("Converting notebook to Python script")
|
|
||||||
from nbconvert import PythonExporter
|
|
||||||
|
|
||||||
exporter = PythonExporter()
|
|
||||||
content, _ = exporter.from_filename(file_name_argument)
|
|
||||||
content = re.sub(r".*get_ipython\(.*", "", content)
|
|
||||||
|
|
||||||
file_name_argument = get_script_name_of_notebook(file_name_argument)
|
|
||||||
|
|
||||||
with open(file_name_argument, "w", encoding="utf-8") as f:
|
|
||||||
f.write(content)
|
|
||||||
|
|
||||||
return re.sub(r"\.(py|ipynb)$", "", file_name_argument)
|
|
||||||
|
|
||||||
|
|
||||||
def get_script_name_of_notebook(notebook_name: str) -> str:
|
|
||||||
base_name = re.sub(r"\.ipynb$", "", notebook_name)
|
|
||||||
return f"__{base_name}__.py"
|
|
||||||
|
|
||||||
|
|
||||||
module = None
|
|
||||||
|
|
||||||
|
|
||||||
def find_app(file_name: str) -> Optional[str]:
|
|
||||||
global module
|
|
||||||
|
|
||||||
logging.disable(logging.CRITICAL)
|
|
||||||
try:
|
|
||||||
if module is None:
|
|
||||||
module = import_module(file_name)
|
|
||||||
else:
|
|
||||||
module = reload(module)
|
|
||||||
except Exception:
|
|
||||||
logging.disable(logging.NOTSET)
|
|
||||||
logger.exception("Could not load file because of an exception: fix your code")
|
|
||||||
return None
|
|
||||||
finally:
|
|
||||||
logging.disable(logging.NOTSET)
|
|
||||||
|
|
||||||
app_name = None
|
|
||||||
for name, value in module.__dict__.items():
|
|
||||||
if isinstance(value, GreatAI):
|
|
||||||
app_name = name
|
|
||||||
|
|
||||||
if app_name:
|
|
||||||
logger.info(f"Found `{app_name}` to be the GreatAI app ")
|
|
||||||
else:
|
|
||||||
raise MissingArgumentError(
|
|
||||||
"GreatAI app could not be found, make sure to use `@GreatAI.create` on your prediction function"
|
|
||||||
)
|
|
||||||
|
|
||||||
return f"{file_name}:{app_name}.app"
|
|
||||||
|
|
||||||
|
|
||||||
class GreatAIReload(BaseReload):
|
|
||||||
def startup(self) -> None:
|
|
||||||
self.process = get_subprocess(
|
|
||||||
config=self.config, target=self.target, sockets=self.sockets
|
|
||||||
)
|
|
||||||
self.process.start()
|
|
||||||
|
|
||||||
def shutdown(self) -> None:
|
|
||||||
self.process.terminate()
|
|
||||||
self.process.join()
|
|
||||||
|
|
||||||
for sock in self.sockets:
|
|
||||||
sock.close()
|
|
||||||
|
|
||||||
|
|
||||||
def main() -> None:
|
|
||||||
import os
|
|
||||||
import sys
|
|
||||||
|
|
||||||
sys.path.append(os.getcwd())
|
|
||||||
|
|
||||||
try:
|
|
||||||
serve()
|
|
||||||
except KeyboardInterrupt:
|
|
||||||
exit()
|
|
||||||
except Exception as e:
|
|
||||||
logger.error(e)
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
|
||||||
main()
|
|
||||||
|
|
@ -1,31 +0,0 @@
|
||||||
from .large_file import LargeFileMongo, LargeFileS3
|
|
||||||
from .persistence.mongodb_driver import MongoDbDriver
|
|
||||||
|
|
||||||
ENV_VAR_KEY = "ENVIRONMENT"
|
|
||||||
PRODUCTION_KEY = "production"
|
|
||||||
DASHBOARD_PATH = "/dashboard"
|
|
||||||
|
|
||||||
MONGO_CONFIG_PATHS = ["mongodb.ini", "mongo.ini", "mongo_db.ini", "mongo-db.ini"]
|
|
||||||
DEFAULT_TRACING_DATABASE_CONFIG_PATHS = {
|
|
||||||
MongoDbDriver: MONGO_CONFIG_PATHS,
|
|
||||||
}
|
|
||||||
|
|
||||||
DEFAULT_LARGE_FILE_CONFIG_PATHS = {
|
|
||||||
LargeFileS3: ["s3.ini", "b2.ini"],
|
|
||||||
LargeFileMongo: MONGO_CONFIG_PATHS,
|
|
||||||
}
|
|
||||||
|
|
||||||
GITHUB_LINK = "https://github.com/schmelczer/great_ai"
|
|
||||||
|
|
||||||
TRAIN_SPLIT_TAG_NAME = "train"
|
|
||||||
TEST_SPLIT_TAG_NAME = "test"
|
|
||||||
VALIDATION_SPLIT_TAG_NAME = "validation"
|
|
||||||
GROUND_TRUTH_TAG_NAME = "ground_truth"
|
|
||||||
PRODUCTION_TAG_NAME = "production"
|
|
||||||
DEVELOPMENT_TAG_NAME = "development"
|
|
||||||
ONLINE_TAG_NAME = "online"
|
|
||||||
|
|
||||||
SERVER_NAME = "GreatAI-Server"
|
|
||||||
|
|
||||||
SE4ML_WEBSITE = "https://se-ml.github.io/practices"
|
|
||||||
LIST_ITEM_PREFIX = " 🔩 "
|
|
||||||
|
|
@ -1,242 +0,0 @@
|
||||||
import os
|
|
||||||
import random
|
|
||||||
from logging import DEBUG, Logger
|
|
||||||
from pathlib import Path
|
|
||||||
from typing import Any, Dict, Optional, Type, Union, cast
|
|
||||||
|
|
||||||
from pydantic import BaseModel, ConfigDict
|
|
||||||
|
|
||||||
from great_ai import __version__
|
|
||||||
|
|
||||||
from .constants import (
|
|
||||||
DEFAULT_LARGE_FILE_CONFIG_PATHS,
|
|
||||||
DEFAULT_TRACING_DATABASE_CONFIG_PATHS,
|
|
||||||
ENV_VAR_KEY,
|
|
||||||
LIST_ITEM_PREFIX,
|
|
||||||
PRODUCTION_KEY,
|
|
||||||
SE4ML_WEBSITE,
|
|
||||||
)
|
|
||||||
from .large_file import LargeFileBase, LargeFileLocal
|
|
||||||
from .persistence.parallel_tinydb_driver import ParallelTinyDbDriver
|
|
||||||
from .persistence.tracing_database_driver import TracingDatabaseDriver
|
|
||||||
from .utilities import get_logger
|
|
||||||
from .views import RouteConfig
|
|
||||||
|
|
||||||
|
|
||||||
class Context(BaseModel):
|
|
||||||
version: Union[int, str]
|
|
||||||
tracing_database: TracingDatabaseDriver
|
|
||||||
large_file_implementation: Type[LargeFileBase]
|
|
||||||
is_production: bool
|
|
||||||
logger: Logger
|
|
||||||
should_log_exception_stack: bool
|
|
||||||
prediction_cache_size: int
|
|
||||||
dashboard_table_size: int
|
|
||||||
route_config: RouteConfig
|
|
||||||
|
|
||||||
model_config = ConfigDict(arbitrary_types_allowed=True)
|
|
||||||
|
|
||||||
def to_flat_dict(self) -> Dict[str, Any]:
|
|
||||||
return {
|
|
||||||
"tracing_database": type(self.tracing_database).__name__,
|
|
||||||
"large_file_implementation": self.large_file_implementation.__name__,
|
|
||||||
"is_production": self.is_production,
|
|
||||||
"should_log_exception_stack": self.should_log_exception_stack,
|
|
||||||
"prediction_cache_size": self.prediction_cache_size,
|
|
||||||
"dashboard_table_size": self.dashboard_table_size,
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
_context: Optional[Context] = None
|
|
||||||
|
|
||||||
|
|
||||||
def get_context() -> Context:
|
|
||||||
if _context is None:
|
|
||||||
configure()
|
|
||||||
|
|
||||||
return cast(Context, _context)
|
|
||||||
|
|
||||||
|
|
||||||
def configure(
|
|
||||||
*,
|
|
||||||
version: Union[int, str] = "0.0.1",
|
|
||||||
log_level: int = DEBUG,
|
|
||||||
seed: int = 42,
|
|
||||||
tracing_database_factory: Optional[Type[TracingDatabaseDriver]] = None,
|
|
||||||
large_file_implementation: Optional[Type[LargeFileBase]] = None,
|
|
||||||
should_log_exception_stack: Optional[bool] = None,
|
|
||||||
prediction_cache_size: int = 512,
|
|
||||||
disable_se4ml_banner: bool = False,
|
|
||||||
dashboard_table_size: int = 50,
|
|
||||||
route_config: RouteConfig = RouteConfig(),
|
|
||||||
) -> None:
|
|
||||||
"""Set the global configuration used by the great-ai library.
|
|
||||||
|
|
||||||
You must call `configure` before calling (or decorating with) any other great-ai
|
|
||||||
function.
|
|
||||||
|
|
||||||
If `tracing_database_factory` or `large_file_implementation` is not specified, their
|
|
||||||
default value is determined based on which TracingDatabase and LargeFile has been
|
|
||||||
configured (e.g.: LargeFileS3.configure_credentials_from_file('s3.ini')), or whether
|
|
||||||
there is any file named s3.ini or mongo.ini in the working directory.
|
|
||||||
|
|
||||||
Examples:
|
|
||||||
>>> configure(prediction_cache_size=0)
|
|
||||||
|
|
||||||
Arguments:
|
|
||||||
version: The version of your application (using SemVer is recommended).
|
|
||||||
log_level: Set the default logging level of `logging`.
|
|
||||||
seed: Set seed of `random` (and `numpy` if installed) for reproducibility.
|
|
||||||
tracing_database_factory: Specify a different TracingDatabaseDriver than the one
|
|
||||||
already configured.
|
|
||||||
large_file_implementation: Specify a different LargeFile than the one already
|
|
||||||
configured.
|
|
||||||
should_log_exception_stack: Log the traces of unhandled exceptions.
|
|
||||||
prediction_cache_size: Size of the LRU cache applied over the prediction
|
|
||||||
functions.
|
|
||||||
disable_se4ml_banner: Turn off the warning about the importance of SE4ML best-
|
|
||||||
practices.
|
|
||||||
dashboard_table_size: Number of rows to display in the dashboard's table.
|
|
||||||
route_config: Enable or disable specific HTTP API endpoints.
|
|
||||||
"""
|
|
||||||
|
|
||||||
global _context
|
|
||||||
logger = get_logger("great_ai", level=log_level)
|
|
||||||
|
|
||||||
if _context is not None:
|
|
||||||
logger.error(
|
|
||||||
"Configuration has been already initialised, overwriting.\n"
|
|
||||||
+ "Make sure to call `configure()` before importing your application code."
|
|
||||||
)
|
|
||||||
|
|
||||||
is_production = _is_in_production_mode(logger=logger)
|
|
||||||
|
|
||||||
_set_seed(seed)
|
|
||||||
|
|
||||||
tracing_database_factory = _initialize_tracing_database(
|
|
||||||
tracing_database_factory, logger=logger
|
|
||||||
)
|
|
||||||
tracing_database = tracing_database_factory()
|
|
||||||
|
|
||||||
if not tracing_database.is_production_ready:
|
|
||||||
message = f"""The selected tracing database ({
|
|
||||||
tracing_database_factory.__name__
|
|
||||||
}) is not recommended for production"""
|
|
||||||
|
|
||||||
if is_production:
|
|
||||||
logger.error(message)
|
|
||||||
else:
|
|
||||||
logger.warning(message)
|
|
||||||
|
|
||||||
_context = Context(
|
|
||||||
version=version,
|
|
||||||
tracing_database=tracing_database,
|
|
||||||
large_file_implementation=_initialize_large_file(
|
|
||||||
large_file_implementation, logger=logger
|
|
||||||
),
|
|
||||||
is_production=is_production,
|
|
||||||
logger=logger,
|
|
||||||
should_log_exception_stack=(
|
|
||||||
not is_production
|
|
||||||
if should_log_exception_stack is None
|
|
||||||
else should_log_exception_stack
|
|
||||||
),
|
|
||||||
prediction_cache_size=prediction_cache_size,
|
|
||||||
dashboard_table_size=dashboard_table_size,
|
|
||||||
route_config=route_config,
|
|
||||||
)
|
|
||||||
|
|
||||||
logger.info(f"GreatAI (v{__version__}): configured ✅")
|
|
||||||
for k, v in get_context().to_flat_dict().items():
|
|
||||||
logger.info(f"{LIST_ITEM_PREFIX}{k}: {v}")
|
|
||||||
|
|
||||||
if not is_production and not disable_se4ml_banner:
|
|
||||||
logger.warning(
|
|
||||||
"You still need to check whether you follow all best practices before "
|
|
||||||
"trusting your deployment."
|
|
||||||
)
|
|
||||||
logger.warning(f"> Find out more at {SE4ML_WEBSITE}")
|
|
||||||
|
|
||||||
|
|
||||||
def _is_in_production_mode(logger: Optional[Logger]) -> bool:
|
|
||||||
environment = os.environ.get(ENV_VAR_KEY)
|
|
||||||
|
|
||||||
if environment is None:
|
|
||||||
if logger:
|
|
||||||
logger.warning(
|
|
||||||
f"Environment variable {ENV_VAR_KEY} is not set, "
|
|
||||||
"defaulting to development mode ‼️"
|
|
||||||
)
|
|
||||||
is_production = False
|
|
||||||
else:
|
|
||||||
is_production = environment.lower() == PRODUCTION_KEY
|
|
||||||
if logger:
|
|
||||||
if not is_production:
|
|
||||||
logger.info(
|
|
||||||
f"Value of {ENV_VAR_KEY} is `{environment}` which is not equal to"
|
|
||||||
+ f"`{PRODUCTION_KEY}` defaulting to development mode ‼️"
|
|
||||||
)
|
|
||||||
else:
|
|
||||||
logger.info("Running in production mode ✅")
|
|
||||||
|
|
||||||
return is_production
|
|
||||||
|
|
||||||
|
|
||||||
def _initialize_tracing_database(
|
|
||||||
selected: Optional[Type[TracingDatabaseDriver]], logger: Logger
|
|
||||||
) -> Type[TracingDatabaseDriver]:
|
|
||||||
for tracing_driver, paths in DEFAULT_TRACING_DATABASE_CONFIG_PATHS.items():
|
|
||||||
if selected is None or selected == tracing_driver:
|
|
||||||
if tracing_driver.initialized:
|
|
||||||
logger.info(
|
|
||||||
f"{tracing_driver.__name__} has been already configured: "
|
|
||||||
"skipping initialisation"
|
|
||||||
)
|
|
||||||
return tracing_driver
|
|
||||||
for p in paths:
|
|
||||||
if Path(p).exists():
|
|
||||||
logger.info(
|
|
||||||
f"""Found credentials file ({Path(p).absolute()}), initialising {
|
|
||||||
tracing_driver.__name__
|
|
||||||
}"""
|
|
||||||
)
|
|
||||||
tracing_driver.configure_credentials_from_file(p)
|
|
||||||
return tracing_driver
|
|
||||||
logger.warning(
|
|
||||||
"Cannot find credentials files, defaulting to using ParallelTinyDbDriver"
|
|
||||||
)
|
|
||||||
return ParallelTinyDbDriver
|
|
||||||
|
|
||||||
|
|
||||||
def _initialize_large_file(
|
|
||||||
selected: Optional[Type[LargeFileBase]], logger: Logger
|
|
||||||
) -> Type[LargeFileBase]:
|
|
||||||
for large_file, paths in DEFAULT_LARGE_FILE_CONFIG_PATHS.items():
|
|
||||||
if selected is None or selected == large_file:
|
|
||||||
if large_file.initialized:
|
|
||||||
logger.info(
|
|
||||||
f"{large_file.__name__} has been already configured: skipping initialisation"
|
|
||||||
)
|
|
||||||
return large_file
|
|
||||||
for p in paths:
|
|
||||||
if Path(p).exists():
|
|
||||||
logger.info(
|
|
||||||
f"""Found credentials file ({Path(p).absolute()}), initialising {
|
|
||||||
large_file.__name__
|
|
||||||
}"""
|
|
||||||
)
|
|
||||||
large_file.configure_credentials_from_file(p)
|
|
||||||
return large_file
|
|
||||||
logger.warning("Cannot find credentials files, defaulting to using LargeFileLocal")
|
|
||||||
return LargeFileLocal
|
|
||||||
|
|
||||||
|
|
||||||
def _set_seed(seed: int) -> None:
|
|
||||||
random.seed(seed)
|
|
||||||
|
|
||||||
try:
|
|
||||||
import numpy
|
|
||||||
|
|
||||||
numpy.random.seed(seed + 1)
|
|
||||||
except ImportError:
|
|
||||||
pass
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
from .great_ai import GreatAI
|
|
||||||
|
|
@ -1,319 +0,0 @@
|
||||||
from functools import lru_cache, wraps
|
|
||||||
from textwrap import dedent
|
|
||||||
from typing import (
|
|
||||||
Any,
|
|
||||||
Awaitable,
|
|
||||||
Callable,
|
|
||||||
Generic,
|
|
||||||
List,
|
|
||||||
Literal,
|
|
||||||
Optional,
|
|
||||||
Sequence,
|
|
||||||
Tuple,
|
|
||||||
TypeVar,
|
|
||||||
Union,
|
|
||||||
cast,
|
|
||||||
overload,
|
|
||||||
)
|
|
||||||
|
|
||||||
from fastapi import FastAPI
|
|
||||||
from tqdm import tqdm
|
|
||||||
|
|
||||||
from ..constants import DASHBOARD_PATH
|
|
||||||
from ..context import get_context
|
|
||||||
from ..external.async_lru import alru_cache
|
|
||||||
from ..helper import freeze_arguments, get_function_metadata_store, snake_case_to_text
|
|
||||||
from ..models.use_model import model_versions
|
|
||||||
from ..parameters.automatically_decorate_parameters import (
|
|
||||||
automatically_decorate_parameters,
|
|
||||||
)
|
|
||||||
from ..tracing.tracing_context import TracingContext
|
|
||||||
from ..utilities import parallel_map
|
|
||||||
from ..views import ApiMetadata, Trace
|
|
||||||
from .routes.bootstrap_dashboard import bootstrap_dashboard
|
|
||||||
from .routes.bootstrap_docs_endpoints import bootstrap_docs_endpoints
|
|
||||||
from .routes.bootstrap_feedback_endpoints import bootstrap_feedback_endpoints
|
|
||||||
from .routes.bootstrap_meta_endpoints import bootstrap_meta_endpoints
|
|
||||||
from .routes.bootstrap_prediction_endpoint import bootstrap_prediction_endpoint
|
|
||||||
from .routes.bootstrap_trace_endpoints import bootstrap_trace_endpoints
|
|
||||||
|
|
||||||
T = TypeVar("T", bound=Union[Trace, Awaitable[Trace]])
|
|
||||||
V = TypeVar("V")
|
|
||||||
|
|
||||||
|
|
||||||
class GreatAI(Generic[T, V]):
|
|
||||||
"""Wrapper for a prediction function providing the implementation of SE4ML best practices.
|
|
||||||
|
|
||||||
Provides caching (with argument freezing), a TracingContext during execution, the
|
|
||||||
scaffolding of HTTP endpoints using FastAPI and a dashboard using Dash.
|
|
||||||
|
|
||||||
IMPORTANT: when a request is served from cache, no new trace is created. Thus, the
|
|
||||||
same trace can be returned multiple times. If this is undesirable turn off caching
|
|
||||||
using `configure(prediction_cache_size=0)`.
|
|
||||||
|
|
||||||
Supports wrapping async and synchronous functions while also maintaining correct
|
|
||||||
typing.
|
|
||||||
|
|
||||||
Attributes:
|
|
||||||
app: FastAPI instance wrapping the scaffolded endpoints and the Dash app.
|
|
||||||
version: SemVer derived from the app's version and the model names and versions
|
|
||||||
registered through use_model.
|
|
||||||
"""
|
|
||||||
|
|
||||||
__name__: str # help for MyPy
|
|
||||||
__doc__: str # help for MyPy
|
|
||||||
|
|
||||||
def __init__(
|
|
||||||
self,
|
|
||||||
func: Callable[..., Union[V, Awaitable[V]]],
|
|
||||||
):
|
|
||||||
"""Do not call this function directly, use GreatAI.create instead."""
|
|
||||||
|
|
||||||
func = automatically_decorate_parameters(func)
|
|
||||||
get_function_metadata_store(func).is_finalised = True
|
|
||||||
|
|
||||||
self._cached_func = self._get_cached_traced_function(func)
|
|
||||||
self._wrapped_func = wraps(func)(freeze_arguments(self._cached_func))
|
|
||||||
|
|
||||||
wraps(func)(self)
|
|
||||||
self.__doc__ = (
|
|
||||||
f"GreatAI wrapper for interacting with the `{self.__name__}` "
|
|
||||||
+ f"function.\n\n{dedent(self.__doc__ or '')}"
|
|
||||||
)
|
|
||||||
|
|
||||||
self.version = str(get_context().version)
|
|
||||||
flat_model_versions = ".".join(f"{k}-v{v}" for k, v in model_versions)
|
|
||||||
if flat_model_versions:
|
|
||||||
self.version += f"+{flat_model_versions}"
|
|
||||||
|
|
||||||
self.app = FastAPI(
|
|
||||||
title=snake_case_to_text(self.__name__),
|
|
||||||
version=self.version,
|
|
||||||
description=self.__doc__
|
|
||||||
+ f"\n\nFind out more in the [dashboard]({DASHBOARD_PATH}).",
|
|
||||||
docs_url=None,
|
|
||||||
redoc_url=None,
|
|
||||||
)
|
|
||||||
|
|
||||||
self._bootstrap_rest_api()
|
|
||||||
|
|
||||||
@overload
|
|
||||||
@staticmethod
|
|
||||||
def create( # type: ignore
|
|
||||||
# Overloaded function signatures 1 and 2 overlap with incompatible return types
|
|
||||||
# https://github.com/python/mypy/issues/12759
|
|
||||||
func: Callable[..., Awaitable[V]],
|
|
||||||
) -> "GreatAI[Awaitable[Trace[V]], V]": ...
|
|
||||||
|
|
||||||
@overload
|
|
||||||
@staticmethod
|
|
||||||
def create(
|
|
||||||
func: Callable[..., V],
|
|
||||||
) -> "GreatAI[Trace[V], V]": ...
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def create(
|
|
||||||
func: Union[Callable[..., Awaitable[V]], Callable[..., V]],
|
|
||||||
) -> Union["GreatAI[Awaitable[Trace[V]], V]", "GreatAI[Trace[V], V]"]:
|
|
||||||
"""Decorate a function by wrapping it in a GreatAI instance.
|
|
||||||
|
|
||||||
The function can be typed, synchronous or async. If it has
|
|
||||||
unwrapped parameters (parameters not affected by a
|
|
||||||
[@parameter][great_ai.parameter] or [@use_model][great_ai.use_model] decorator),
|
|
||||||
those will be automatically wrapped.
|
|
||||||
|
|
||||||
The return value is replaced by a Trace (or Awaitable[Trace]),
|
|
||||||
while the original return value is available under the `.output`
|
|
||||||
property.
|
|
||||||
|
|
||||||
For configuration options, see [great_ai.configure][].
|
|
||||||
|
|
||||||
Examples:
|
|
||||||
>>> @GreatAI.create
|
|
||||||
... def my_function(a):
|
|
||||||
... return a + 2
|
|
||||||
>>> my_function(3).output
|
|
||||||
5
|
|
||||||
|
|
||||||
>>> @GreatAI.create
|
|
||||||
... def my_function(a: int) -> int:
|
|
||||||
... return a + 2
|
|
||||||
>>> my_function(3)
|
|
||||||
Trace[int]...
|
|
||||||
|
|
||||||
>>> my_function('3').output
|
|
||||||
Traceback (most recent call last):
|
|
||||||
...
|
|
||||||
TypeError: argument a is not of the expected type: ...
|
|
||||||
|
|
||||||
Args:
|
|
||||||
func: The prediction function that needs to be decorated.
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
A GreatAI instance wrapping `func`.
|
|
||||||
"""
|
|
||||||
|
|
||||||
return GreatAI[Trace[V], V](
|
|
||||||
func,
|
|
||||||
)
|
|
||||||
|
|
||||||
def __call__(self, *args: Any, **kwargs: Any) -> T:
|
|
||||||
return self._wrapped_func(*args, **kwargs)
|
|
||||||
|
|
||||||
@overload
|
|
||||||
def process_batch(
|
|
||||||
self,
|
|
||||||
batch: Sequence[Tuple],
|
|
||||||
*,
|
|
||||||
concurrency: Optional[int] = None,
|
|
||||||
unpack_arguments: Literal[True],
|
|
||||||
do_not_persist_traces: bool = ...,
|
|
||||||
) -> List[Trace[V]]: ...
|
|
||||||
|
|
||||||
@overload
|
|
||||||
def process_batch(
|
|
||||||
self,
|
|
||||||
batch: Sequence,
|
|
||||||
*,
|
|
||||||
concurrency: Optional[int] = None,
|
|
||||||
unpack_arguments: Literal[False] = ...,
|
|
||||||
do_not_persist_traces: bool = ...,
|
|
||||||
) -> List[Trace[V]]: ...
|
|
||||||
|
|
||||||
def process_batch(
|
|
||||||
self,
|
|
||||||
batch: Sequence,
|
|
||||||
*,
|
|
||||||
concurrency: Optional[int] = None,
|
|
||||||
unpack_arguments: bool = False,
|
|
||||||
do_not_persist_traces: bool = False,
|
|
||||||
) -> List[Trace[V]]:
|
|
||||||
"""Map the wrapped function over a list of input_values (`batch`).
|
|
||||||
|
|
||||||
A wrapper over [parallel_map][great_ai.utilities.parallel_map.parallel_map.parallel_map]
|
|
||||||
providing type-safety and a progressbar through tqdm.
|
|
||||||
|
|
||||||
Args:
|
|
||||||
batch: A list of arguments for the original (wrapped) function. If the
|
|
||||||
function expects multiple arguments, provide a list of tuples and set
|
|
||||||
`unpack_arguments=True`.
|
|
||||||
concurrency: Number of processes to start. Don't set it too much higher than
|
|
||||||
the number of available CPU cores.
|
|
||||||
unpack_arguments: Expect a list of tuples and unpack the tuples before
|
|
||||||
giving them to the wrapped function.
|
|
||||||
do_not_persist_traces: Don't save the traces in the database. Useful for
|
|
||||||
evaluations run part of the CI.
|
|
||||||
"""
|
|
||||||
|
|
||||||
wrapped_function = self._wrapped_func
|
|
||||||
|
|
||||||
def inner(value: Any) -> T:
|
|
||||||
return (
|
|
||||||
wrapped_function(*value, do_not_persist_traces=do_not_persist_traces)
|
|
||||||
if unpack_arguments
|
|
||||||
else wrapped_function(
|
|
||||||
value, do_not_persist_traces=do_not_persist_traces
|
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
async def inner_async(value: Any) -> T:
|
|
||||||
return await cast(
|
|
||||||
Awaitable,
|
|
||||||
(
|
|
||||||
wrapped_function(
|
|
||||||
*value, do_not_persist_traces=do_not_persist_traces
|
|
||||||
)
|
|
||||||
if unpack_arguments
|
|
||||||
else wrapped_function(
|
|
||||||
value, do_not_persist_traces=do_not_persist_traces
|
|
||||||
)
|
|
||||||
),
|
|
||||||
)
|
|
||||||
|
|
||||||
# inner/inner_async return the class' T (bound to Trace | Awaitable[Trace]);
|
|
||||||
# in this method T resolves to Trace[V], but that is not provable to mypy, so
|
|
||||||
# cast to the concrete shape parallel_map expects.
|
|
||||||
map_function = cast(
|
|
||||||
Callable[[Any], Union[Trace[V], Awaitable[Trace[V]]]],
|
|
||||||
inner_async if get_function_metadata_store(self).is_asynchronous else inner,
|
|
||||||
)
|
|
||||||
|
|
||||||
return list(
|
|
||||||
tqdm(
|
|
||||||
parallel_map(map_function, batch, concurrency=concurrency),
|
|
||||||
total=len(batch),
|
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def _get_cached_traced_function(
|
|
||||||
func: Callable[..., Union[V, Awaitable[V]]],
|
|
||||||
) -> Callable[..., T]:
|
|
||||||
@lru_cache(maxsize=get_context().prediction_cache_size)
|
|
||||||
def func_in_tracing_context_sync(
|
|
||||||
*args: Any,
|
|
||||||
do_not_persist_traces: bool = False,
|
|
||||||
**kwargs: Any,
|
|
||||||
) -> T:
|
|
||||||
with TracingContext[V](
|
|
||||||
func.__name__, do_not_persist_traces=do_not_persist_traces
|
|
||||||
) as t:
|
|
||||||
result = func(*args, **kwargs)
|
|
||||||
return cast(T, t.finalise(output=result))
|
|
||||||
|
|
||||||
@alru_cache(maxsize=get_context().prediction_cache_size)
|
|
||||||
async def func_in_tracing_context_async(
|
|
||||||
*args: Any,
|
|
||||||
do_not_persist_traces: bool = False,
|
|
||||||
**kwargs: Any,
|
|
||||||
) -> T:
|
|
||||||
with TracingContext[V](
|
|
||||||
func.__name__, do_not_persist_traces=do_not_persist_traces
|
|
||||||
) as t:
|
|
||||||
result = await cast(Callable[..., Awaitable], func)(*args, **kwargs)
|
|
||||||
return cast(T, t.finalise(output=result))
|
|
||||||
|
|
||||||
return cast(
|
|
||||||
Callable[..., T],
|
|
||||||
(
|
|
||||||
func_in_tracing_context_async
|
|
||||||
if get_function_metadata_store(func).is_asynchronous
|
|
||||||
else func_in_tracing_context_sync
|
|
||||||
),
|
|
||||||
)
|
|
||||||
|
|
||||||
def _bootstrap_rest_api(
|
|
||||||
self,
|
|
||||||
) -> None:
|
|
||||||
route_config = get_context().route_config
|
|
||||||
|
|
||||||
if route_config.prediction_endpoint_enabled:
|
|
||||||
bootstrap_prediction_endpoint(self.app, self._wrapped_func)
|
|
||||||
|
|
||||||
if route_config.docs_endpoints_enabled:
|
|
||||||
bootstrap_docs_endpoints(self.app)
|
|
||||||
|
|
||||||
if route_config.dashboard_enabled:
|
|
||||||
bootstrap_dashboard(
|
|
||||||
self.app,
|
|
||||||
function_name=self.__name__,
|
|
||||||
documentation=self.__doc__,
|
|
||||||
)
|
|
||||||
|
|
||||||
if route_config.trace_endpoints_enabled:
|
|
||||||
bootstrap_trace_endpoints(self.app)
|
|
||||||
|
|
||||||
if route_config.feedback_endpoints_enabled:
|
|
||||||
bootstrap_feedback_endpoints(self.app)
|
|
||||||
|
|
||||||
if route_config.meta_endpoints_enabled:
|
|
||||||
bootstrap_meta_endpoints(
|
|
||||||
self.app,
|
|
||||||
self._cached_func,
|
|
||||||
ApiMetadata(
|
|
||||||
name=self.__name__,
|
|
||||||
version=self.version,
|
|
||||||
documentation=self.__doc__,
|
|
||||||
configuration=get_context().to_flat_dict(),
|
|
||||||
),
|
|
||||||
)
|
|
||||||
|
|
@ -1,6 +0,0 @@
|
||||||
from .bootstrap_dashboard import bootstrap_dashboard
|
|
||||||
from .bootstrap_docs_endpoints import bootstrap_docs_endpoints
|
|
||||||
from .bootstrap_feedback_endpoints import bootstrap_feedback_endpoints
|
|
||||||
from .bootstrap_meta_endpoints import bootstrap_meta_endpoints
|
|
||||||
from .bootstrap_prediction_endpoint import bootstrap_prediction_endpoint
|
|
||||||
from .bootstrap_trace_endpoints import bootstrap_trace_endpoints
|
|
||||||
|
|
@ -1,35 +0,0 @@
|
||||||
from pathlib import Path
|
|
||||||
|
|
||||||
from a2wsgi import WSGIMiddleware
|
|
||||||
from fastapi import FastAPI
|
|
||||||
from fastapi.responses import FileResponse, RedirectResponse
|
|
||||||
from fastapi.staticfiles import StaticFiles
|
|
||||||
|
|
||||||
from ...constants import DASHBOARD_PATH
|
|
||||||
from .dashboard.create_dash_app import create_dash_app
|
|
||||||
|
|
||||||
PATH = Path(__file__).parent.resolve()
|
|
||||||
|
|
||||||
|
|
||||||
def bootstrap_dashboard(app: FastAPI, function_name: str, documentation: str) -> None:
|
|
||||||
dash_app = create_dash_app(function_name, app.version, documentation)
|
|
||||||
|
|
||||||
@app.get("/favicon.ico", include_in_schema=False)
|
|
||||||
@app.get(f"{DASHBOARD_PATH}/_favicon.ico", include_in_schema=False)
|
|
||||||
def get_favicon() -> FileResponse:
|
|
||||||
return FileResponse(PATH / "dashboard/assets/favicon.ico")
|
|
||||||
|
|
||||||
# a2wsgi types its WSGI input (Flask) and ASGI output more strictly than
|
|
||||||
# Starlette's loose WSGIApp/ASGIApp aliases, so mypy flags the mount despite
|
|
||||||
# this being the canonical, runtime-correct way to bridge the Dash app.
|
|
||||||
app.mount(DASHBOARD_PATH, WSGIMiddleware(dash_app)) # type: ignore[arg-type]
|
|
||||||
|
|
||||||
@app.get("/", include_in_schema=False)
|
|
||||||
def redirect_to_entrypoint() -> RedirectResponse:
|
|
||||||
return RedirectResponse(DASHBOARD_PATH)
|
|
||||||
|
|
||||||
app.mount(
|
|
||||||
"/assets",
|
|
||||||
StaticFiles(directory=PATH / "dashboard/assets"),
|
|
||||||
name="static",
|
|
||||||
)
|
|
||||||
|
|
@ -1,18 +0,0 @@
|
||||||
from fastapi import FastAPI
|
|
||||||
from fastapi.openapi.docs import get_swagger_ui_html
|
|
||||||
from fastapi.responses import RedirectResponse
|
|
||||||
from starlette.responses import HTMLResponse
|
|
||||||
|
|
||||||
|
|
||||||
def bootstrap_docs_endpoints(app: FastAPI) -> None:
|
|
||||||
@app.get("/docs", include_in_schema=False)
|
|
||||||
def custom_swagger_ui_html() -> HTMLResponse:
|
|
||||||
return get_swagger_ui_html(
|
|
||||||
openapi_url="openapi.json",
|
|
||||||
title=app.title,
|
|
||||||
swagger_favicon_url="/favicon.ico",
|
|
||||||
)
|
|
||||||
|
|
||||||
@app.get("/docs/index.html", include_in_schema=False)
|
|
||||||
def redirect_to_docs() -> RedirectResponse:
|
|
||||||
return RedirectResponse("/docs")
|
|
||||||
|
|
@ -1,44 +0,0 @@
|
||||||
from typing import Any
|
|
||||||
|
|
||||||
from fastapi import APIRouter, FastAPI, HTTPException, Response, status
|
|
||||||
|
|
||||||
from ...context import get_context
|
|
||||||
from ...views import EvaluationFeedbackRequest
|
|
||||||
|
|
||||||
|
|
||||||
def bootstrap_feedback_endpoints(app: FastAPI) -> None:
|
|
||||||
router = APIRouter(
|
|
||||||
prefix="/traces/{trace_id}/feedback",
|
|
||||||
tags=["feedback"],
|
|
||||||
)
|
|
||||||
|
|
||||||
@router.put("/", status_code=status.HTTP_202_ACCEPTED)
|
|
||||||
def set_feedback(trace_id: str, input: EvaluationFeedbackRequest) -> Response:
|
|
||||||
trace = get_context().tracing_database.get(trace_id)
|
|
||||||
if trace is None:
|
|
||||||
raise HTTPException(status_code=status.HTTP_404_NOT_FOUND)
|
|
||||||
|
|
||||||
trace.feedback = input.feedback
|
|
||||||
|
|
||||||
get_context().tracing_database.update(trace_id, trace)
|
|
||||||
return Response(status_code=status.HTTP_202_ACCEPTED)
|
|
||||||
|
|
||||||
@router.get("/", status_code=status.HTTP_200_OK)
|
|
||||||
def get_feedback(trace_id: str) -> Any:
|
|
||||||
trace = get_context().tracing_database.get(trace_id)
|
|
||||||
if trace is None:
|
|
||||||
raise HTTPException(status_code=status.HTTP_404_NOT_FOUND)
|
|
||||||
return trace.feedback
|
|
||||||
|
|
||||||
@router.delete("/", status_code=status.HTTP_204_NO_CONTENT)
|
|
||||||
def delete_feedback(trace_id: str) -> Response:
|
|
||||||
trace = get_context().tracing_database.get(trace_id)
|
|
||||||
if trace is None:
|
|
||||||
raise HTTPException(status_code=status.HTTP_404_NOT_FOUND)
|
|
||||||
|
|
||||||
trace.feedback = None
|
|
||||||
|
|
||||||
get_context().tracing_database.update(trace_id, trace)
|
|
||||||
return Response(status_code=status.HTTP_204_NO_CONTENT)
|
|
||||||
|
|
||||||
app.include_router(router)
|
|
||||||
|
|
@ -1,26 +0,0 @@
|
||||||
from typing import Any
|
|
||||||
|
|
||||||
from fastapi import APIRouter, FastAPI, status
|
|
||||||
|
|
||||||
from ...views import ApiMetadata, CacheStatistics, HealthCheckResponse
|
|
||||||
|
|
||||||
|
|
||||||
def bootstrap_meta_endpoints(app: FastAPI, func: Any, metadata: ApiMetadata) -> None:
|
|
||||||
router = APIRouter(
|
|
||||||
tags=["meta"],
|
|
||||||
)
|
|
||||||
|
|
||||||
@router.get("/health", status_code=status.HTTP_200_OK)
|
|
||||||
def check_health() -> HealthCheckResponse:
|
|
||||||
hits, misses, maxsize, cache_size = func.cache_info()
|
|
||||||
cache_statistics = CacheStatistics(
|
|
||||||
hits=hits, misses=misses, size=cache_size, max_size=maxsize
|
|
||||||
)
|
|
||||||
|
|
||||||
return HealthCheckResponse(is_healthy=True, cache_statistics=cache_statistics)
|
|
||||||
|
|
||||||
@router.get("/version", response_model=ApiMetadata, status_code=status.HTTP_200_OK)
|
|
||||||
def get_version() -> ApiMetadata:
|
|
||||||
return metadata
|
|
||||||
|
|
||||||
app.include_router(router)
|
|
||||||
|
|
@ -1,51 +0,0 @@
|
||||||
import inspect
|
|
||||||
from typing import Any, Awaitable, Callable, Type, Union, cast
|
|
||||||
|
|
||||||
from fastapi import APIRouter, FastAPI, HTTPException, status
|
|
||||||
from pydantic import BaseModel, create_model
|
|
||||||
|
|
||||||
from ...helper import get_function_metadata_store
|
|
||||||
from ...views import Trace
|
|
||||||
|
|
||||||
|
|
||||||
def bootstrap_prediction_endpoint(
|
|
||||||
app: FastAPI, func: Callable[..., Union[Trace, Awaitable[Trace]]]
|
|
||||||
) -> None:
|
|
||||||
router = APIRouter(
|
|
||||||
tags=["predictions"],
|
|
||||||
)
|
|
||||||
|
|
||||||
schema = _get_schema(func)
|
|
||||||
|
|
||||||
@router.post("/predict", status_code=status.HTTP_200_OK, response_model=Trace)
|
|
||||||
async def predict(input_value: schema) -> Trace: # type: ignore
|
|
||||||
try:
|
|
||||||
if inspect.iscoroutinefunction(func):
|
|
||||||
return await cast(Callable[..., Awaitable[Trace]], func)(
|
|
||||||
**cast(BaseModel, input_value).model_dump()
|
|
||||||
)
|
|
||||||
return cast(Callable[..., Trace], func)(
|
|
||||||
**cast(BaseModel, input_value).model_dump()
|
|
||||||
)
|
|
||||||
except Exception as e:
|
|
||||||
raise HTTPException(
|
|
||||||
status_code=status.HTTP_500_INTERNAL_SERVER_ERROR,
|
|
||||||
detail=f"The following exception has occurred: {type(e).__name__}: {e}",
|
|
||||||
)
|
|
||||||
|
|
||||||
app.include_router(router)
|
|
||||||
|
|
||||||
|
|
||||||
def _get_schema(func: Callable) -> Type[BaseModel]:
|
|
||||||
signature = inspect.signature(func)
|
|
||||||
parameters = {
|
|
||||||
p.name: (
|
|
||||||
p.annotation if p.annotation != inspect._empty else Any,
|
|
||||||
p.default if p.default != inspect._empty else ...,
|
|
||||||
)
|
|
||||||
for p in signature.parameters.values()
|
|
||||||
if p.name in get_function_metadata_store(func).input_parameter_names
|
|
||||||
}
|
|
||||||
|
|
||||||
schema: Type[BaseModel] = create_model("InputModel", **parameters) # type: ignore
|
|
||||||
return schema
|
|
||||||
|
|
@ -1,44 +0,0 @@
|
||||||
from typing import List
|
|
||||||
|
|
||||||
from fastapi import APIRouter, FastAPI, HTTPException, Response, status
|
|
||||||
|
|
||||||
from ...context import get_context
|
|
||||||
from ...views import Query, Trace
|
|
||||||
|
|
||||||
|
|
||||||
def bootstrap_trace_endpoints(app: FastAPI) -> None:
|
|
||||||
router = APIRouter(
|
|
||||||
prefix="/traces",
|
|
||||||
tags=["traces"],
|
|
||||||
)
|
|
||||||
|
|
||||||
@router.post("", status_code=status.HTTP_200_OK, response_model=List[Trace])
|
|
||||||
def query_traces(
|
|
||||||
query: Query,
|
|
||||||
skip: int = 0,
|
|
||||||
take: int = 100,
|
|
||||||
) -> List[Trace]:
|
|
||||||
return get_context().tracing_database.query(
|
|
||||||
conjunctive_filters=query.filter,
|
|
||||||
conjunctive_tags=query.conjunctive_tags,
|
|
||||||
since=query.since,
|
|
||||||
until=query.until,
|
|
||||||
has_feedback=query.has_feedback,
|
|
||||||
sort_by=query.sort,
|
|
||||||
skip=skip,
|
|
||||||
take=take,
|
|
||||||
)[0]
|
|
||||||
|
|
||||||
@router.get("/{trace_id}", status_code=status.HTTP_200_OK, response_model=Trace)
|
|
||||||
def get_trace(trace_id: str) -> Trace:
|
|
||||||
result = get_context().tracing_database.get(trace_id)
|
|
||||||
if result is None:
|
|
||||||
raise HTTPException(status_code=status.HTTP_404_NOT_FOUND)
|
|
||||||
return result
|
|
||||||
|
|
||||||
@router.delete("/{trace_id}", status_code=status.HTTP_204_NO_CONTENT)
|
|
||||||
def delete_trace(trace_id: str) -> Response:
|
|
||||||
get_context().tracing_database.delete(trace_id)
|
|
||||||
return Response(status_code=status.HTTP_204_NO_CONTENT)
|
|
||||||
|
|
||||||
app.include_router(router)
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
from .create_dash_app import create_dash_app
|
|
||||||
|
Before Width: | Height: | Size: 15 KiB |
|
|
@ -1,235 +0,0 @@
|
||||||
:root {
|
|
||||||
--background-color: #edf5f6;
|
|
||||||
--dark-background-color: #e7eced;
|
|
||||||
--light-text-color: #747879;
|
|
||||||
--small-padding: 10px;
|
|
||||||
--medium-padding: 20px;
|
|
||||||
--large-padding: 40px;
|
|
||||||
--border-radius: 10px;
|
|
||||||
--shadow: 0 4px 6px -1px rgb(0 0 0 / 10%), 0 2px 4px -1px rgb(0 0 0 / 6%);
|
|
||||||
--disclaimer-width: 180px;
|
|
||||||
--disclaimer-height: 35px;
|
|
||||||
}
|
|
||||||
|
|
||||||
@media (max-width: 900px) {
|
|
||||||
body {
|
|
||||||
zoom: 0.8;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@media (max-width: 550px) {
|
|
||||||
:root {
|
|
||||||
--small-padding: 5px;
|
|
||||||
--medium-padding: 10px;
|
|
||||||
--large-padding: 20px;
|
|
||||||
--border-radius: 8px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.environment {
|
|
||||||
margin-top: calc(-1 * var(--large-padding));
|
|
||||||
margin-bottom: var(--large-padding);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@media (min-width: 551px) {
|
|
||||||
.environment {
|
|
||||||
position: absolute;
|
|
||||||
width: var(--disclaimer-width);
|
|
||||||
height: var(--disclaimer-height);
|
|
||||||
transform: rotate(-45deg);
|
|
||||||
top: calc(
|
|
||||||
var(--disclaimer-width) / 1.4142 - var(--disclaimer-height) / 1.4142
|
|
||||||
);
|
|
||||||
left: calc(-1 * var(--disclaimer-height) / 1.4142);
|
|
||||||
transform-origin: top left;
|
|
||||||
z-index: 100;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
* {
|
|
||||||
margin: 0;
|
|
||||||
box-sizing: border-box;
|
|
||||||
word-break: break-word;
|
|
||||||
}
|
|
||||||
|
|
||||||
body {
|
|
||||||
background-color: var(--background-color);
|
|
||||||
font-family: Arial, Helvetica, sans-serif;
|
|
||||||
}
|
|
||||||
|
|
||||||
h1,
|
|
||||||
h2,
|
|
||||||
h3,
|
|
||||||
h4,
|
|
||||||
h5,
|
|
||||||
h6 {
|
|
||||||
margin: var(--medium-padding) 0 var(--small-padding) 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
h6 {
|
|
||||||
margin-top: 0;
|
|
||||||
font-size: 3rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
html,
|
|
||||||
body,
|
|
||||||
#react-entry-point,
|
|
||||||
main {
|
|
||||||
height: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
main {
|
|
||||||
padding-top: var(--large-padding);
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
}
|
|
||||||
|
|
||||||
.environment {
|
|
||||||
color: white;
|
|
||||||
text-align: center;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
main > header,
|
|
||||||
.configuration-container,
|
|
||||||
.traces-table-container,
|
|
||||||
.parallel-coordinates,
|
|
||||||
main > footer {
|
|
||||||
padding: var(--large-padding);
|
|
||||||
flex-shrink: 0;
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
|
||||||
|
|
||||||
main > header,
|
|
||||||
.configuration-container,
|
|
||||||
.traces-table-container,
|
|
||||||
.parallel-coordinates {
|
|
||||||
margin: 0 var(--large-padding) var(--large-padding) var(--large-padding);
|
|
||||||
border-radius: var(--border-radius);
|
|
||||||
box-shadow: var(--shadow);
|
|
||||||
background-color: white;
|
|
||||||
}
|
|
||||||
|
|
||||||
main > header {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
justify-content: space-between;
|
|
||||||
}
|
|
||||||
|
|
||||||
main > header > div:nth-child(1) {
|
|
||||||
min-width: 350px;
|
|
||||||
max-width: 450px;
|
|
||||||
flex: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
main > header > div > h1 {
|
|
||||||
margin-top: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.version-tag {
|
|
||||||
border-radius: var(--border-radius);
|
|
||||||
display: inline-block;
|
|
||||||
font-size: 1rem;
|
|
||||||
padding: 3px 8px;
|
|
||||||
margin-left: var(--small-padding)
|
|
||||||
}
|
|
||||||
|
|
||||||
main > header .version-tag {
|
|
||||||
background: var(--background-color);
|
|
||||||
vertical-align: 4px;
|
|
||||||
}
|
|
||||||
|
|
||||||
main > header > *:nth-child(2) {
|
|
||||||
min-width: 250px;
|
|
||||||
max-width: 550px;
|
|
||||||
flex: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
main > header .placeholder {
|
|
||||||
color: var(--light-text-color);
|
|
||||||
font-size: 1.5rem;
|
|
||||||
text-align: center;
|
|
||||||
display: block;
|
|
||||||
min-width: 250px;
|
|
||||||
width: 60%;
|
|
||||||
margin: auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
.configuration-container {
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
}
|
|
||||||
|
|
||||||
.configuration-item {
|
|
||||||
padding-left: var(--small-padding);
|
|
||||||
margin: var(--medium-padding);
|
|
||||||
}
|
|
||||||
|
|
||||||
.configuration-item h4 {
|
|
||||||
font-weight: bold;
|
|
||||||
margin: 0 0 var(--small-padding) 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.traces-table-container {
|
|
||||||
padding: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.traces-table-container header {
|
|
||||||
padding: var(--large-padding);
|
|
||||||
}
|
|
||||||
|
|
||||||
.traces-table-container header h2 {
|
|
||||||
margin-top: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.dash-filter--case {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.traces-table-container td > div {
|
|
||||||
white-space: pre !important;
|
|
||||||
max-height: 150px !important;
|
|
||||||
overflow: auto !important;
|
|
||||||
display: inline-block !important;
|
|
||||||
text-align: left !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.traces-table-container th > div {
|
|
||||||
text-align: left !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.space-filler {
|
|
||||||
flex-grow: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
main > footer {
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
align-items: center;
|
|
||||||
padding: var(--large-padding);
|
|
||||||
background-color: var(--dark-background-color);
|
|
||||||
color: var(--light-text-color);
|
|
||||||
position: relative;
|
|
||||||
}
|
|
||||||
|
|
||||||
.parallel-coordinates {
|
|
||||||
padding: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
a img {
|
|
||||||
display: block;
|
|
||||||
margin-left: var(--large-padding);
|
|
||||||
width: 80px;
|
|
||||||
height: 80px;
|
|
||||||
cursor: pointer;
|
|
||||||
transition: transform 300ms;
|
|
||||||
opacity: 0.6;
|
|
||||||
}
|
|
||||||
|
|
||||||
a img:hover {
|
|
||||||
transform: scale(1.1);
|
|
||||||
}
|
|
||||||
|
Before Width: | Height: | Size: 84 KiB |
|
|
@ -1,34 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<svg viewBox="-8 -8 516 516" xmlns="http://www.w3.org/2000/svg" xmlns:bx="https://boxy-svg.com">
|
|
||||||
<defs>
|
|
||||||
<style bx:fonts="Baloo 2">@import url(https://fonts.googleapis.com/css2?family=Baloo+2%3Aital%2Cwght%400%2C400%3B0%2C500%3B0%2C600%3B0%2C700%3B0%2C800&display=swap);</style>
|
|
||||||
<g id="arrow">
|
|
||||||
<polyline style="stroke-linecap: round; stroke-linejoin: round; stroke-width: 16px; fill: none;" points="0 0 150 0 150 150"/>
|
|
||||||
<polyline style="stroke-linecap: round; stroke-width: 16px;" points="150 0 75 75"/>
|
|
||||||
</g>
|
|
||||||
<defs>
|
|
||||||
<linearGradient id="foreground">
|
|
||||||
<stop offset="0" stop-color="#44BBA4"/>
|
|
||||||
<stop offset="1" stop-color="#0C6291"/>
|
|
||||||
</linearGradient>
|
|
||||||
</defs>
|
|
||||||
<filter id="brightness-filter-0" x="-500%" y="-500%" width="1000%" height="1000%" bx:preset="brightness 1 1.6">
|
|
||||||
<feComponentTransfer>
|
|
||||||
<feFuncR type="linear" slope="1.6"/>
|
|
||||||
<feFuncG type="linear" slope="1.6"/>
|
|
||||||
<feFuncB type="linear" slope="1.6"/>
|
|
||||||
</feComponentTransfer>
|
|
||||||
</filter>
|
|
||||||
</defs>
|
|
||||||
<g style="filter: url(#brightness-filter-0);">
|
|
||||||
<g transform="matrix(1, 0, 0, 1, 350, 0)" stroke="#44BBA4">
|
|
||||||
<polyline style="stroke-linecap: round; stroke-linejoin: round; stroke-width: 16px; fill: none;" points="0 0 150 0 150 150"/>
|
|
||||||
<polyline style="stroke-linecap: round; stroke-width: 16px;" points="150 0 75 75"/>
|
|
||||||
</g>
|
|
||||||
<g transform="matrix(-1, 0, 0, -1, 150.136902, 499.826965)" stroke="#0C6291">
|
|
||||||
<polyline style="stroke-linecap: round; stroke-linejoin: round; stroke-width: 16px; fill: none;" points="0 0 150 0 150 150"/>
|
|
||||||
<polyline style="stroke-linecap: round; stroke-width: 16px;" points="150 0 75 75"/>
|
|
||||||
</g>
|
|
||||||
</g>
|
|
||||||
<text style="fill: url(#foreground); font-family: "Baloo 2"; font-size: 450px; letter-spacing: -12.3px; white-space: pre; filter: url(#brightness-filter-0);" x="78" y="388">AI</text>
|
|
||||||
</svg>
|
|
||||||
|
Before Width: | Height: | Size: 1.9 KiB |
|
|
@ -1,281 +0,0 @@
|
||||||
from math import ceil
|
|
||||||
from typing import Any, Dict, List, Optional, Sequence, Tuple, Union
|
|
||||||
|
|
||||||
import pandas as pd
|
|
||||||
import plotly.express as px
|
|
||||||
import plotly.graph_objects as go
|
|
||||||
from dash import Dash, dcc, html
|
|
||||||
from dash.dependencies import Input, Output
|
|
||||||
from flask import Flask
|
|
||||||
|
|
||||||
from ....constants import DASHBOARD_PATH, ONLINE_TAG_NAME
|
|
||||||
from ....context import get_context
|
|
||||||
from ....helper import freeze, snake_case_to_text, text_to_hex_color
|
|
||||||
from ....utilities import unique
|
|
||||||
from ....views import SortBy, Trace
|
|
||||||
from .get_description import get_description
|
|
||||||
from .get_filter_from_datatable import get_filter_from_datatable
|
|
||||||
from .get_footer import get_footer
|
|
||||||
from .get_traces_table import get_traces_table
|
|
||||||
|
|
||||||
|
|
||||||
def create_dash_app(function_name: str, version: str, function_docs: str) -> Flask:
|
|
||||||
accent_color = text_to_hex_color(function_name)
|
|
||||||
function_name = snake_case_to_text(function_name)
|
|
||||||
|
|
||||||
app = Dash(
|
|
||||||
function_name,
|
|
||||||
requests_pathname_prefix=DASHBOARD_PATH + "/",
|
|
||||||
server=Flask(__name__), # type: ignore[arg-type]
|
|
||||||
title=function_name,
|
|
||||||
update_title=None, # type: ignore[arg-type]
|
|
||||||
external_stylesheets=[
|
|
||||||
"/assets/index.css",
|
|
||||||
],
|
|
||||||
)
|
|
||||||
|
|
||||||
execution_time_histogram_container = html.Div()
|
|
||||||
configuration_container = html.Div(
|
|
||||||
className="configuration-container",
|
|
||||||
)
|
|
||||||
table = get_traces_table()
|
|
||||||
traces_table_container = html.Div(
|
|
||||||
[
|
|
||||||
html.Header(
|
|
||||||
[
|
|
||||||
html.H2("Latest traces"),
|
|
||||||
html.P(
|
|
||||||
"Recent traces and aggregated metrics are presented below. Try filtering the table."
|
|
||||||
),
|
|
||||||
html.A(
|
|
||||||
"Filtering syntax.",
|
|
||||||
href="https://dash.plotly.com/datatable/filtering",
|
|
||||||
target="_blank",
|
|
||||||
),
|
|
||||||
]
|
|
||||||
),
|
|
||||||
table,
|
|
||||||
],
|
|
||||||
className="traces-table-container",
|
|
||||||
)
|
|
||||||
parallel_coordinates = dcc.Graph(
|
|
||||||
className="parallel-coordinates", config={"displaylogo": False}
|
|
||||||
)
|
|
||||||
interval = dcc.Interval(
|
|
||||||
interval=2 * 1000, # in milliseconds
|
|
||||||
n_intervals=0,
|
|
||||||
max_intervals=(
|
|
||||||
1 if get_context().is_production else -1
|
|
||||||
), # will be incremented in production upon each successful request
|
|
||||||
)
|
|
||||||
|
|
||||||
app.layout = html.Main(
|
|
||||||
[
|
|
||||||
html.Div(
|
|
||||||
html.P("PRODUCTION" if get_context().is_production else "DEVELOPMENT"),
|
|
||||||
className="environment",
|
|
||||||
style={"background": accent_color},
|
|
||||||
),
|
|
||||||
html.Header(
|
|
||||||
[
|
|
||||||
get_description(
|
|
||||||
function_name=function_name,
|
|
||||||
version=version,
|
|
||||||
function_docs=function_docs,
|
|
||||||
accent_color=accent_color,
|
|
||||||
),
|
|
||||||
execution_time_histogram_container,
|
|
||||||
],
|
|
||||||
),
|
|
||||||
configuration_container,
|
|
||||||
traces_table_container,
|
|
||||||
parallel_coordinates,
|
|
||||||
html.Div(className="space-filler"),
|
|
||||||
get_footer(),
|
|
||||||
interval,
|
|
||||||
]
|
|
||||||
)
|
|
||||||
|
|
||||||
@app.callback(
|
|
||||||
Output(configuration_container, "children"),
|
|
||||||
Input(interval, "n_intervals"),
|
|
||||||
)
|
|
||||||
def update_configuration(
|
|
||||||
n_intervals: int,
|
|
||||||
) -> List[html.Div]:
|
|
||||||
config = get_context().to_flat_dict()
|
|
||||||
return [
|
|
||||||
html.Div(
|
|
||||||
[
|
|
||||||
html.H4(snake_case_to_text(key)),
|
|
||||||
html.P(str(value)),
|
|
||||||
],
|
|
||||||
className="configuration-item",
|
|
||||||
style={"border-left": f"2px solid {accent_color}"},
|
|
||||||
)
|
|
||||||
for key, value in config.items()
|
|
||||||
]
|
|
||||||
|
|
||||||
@app.callback(
|
|
||||||
Output(table, "data"),
|
|
||||||
Output(table, "page_count"),
|
|
||||||
Output(table, "columns"),
|
|
||||||
Output(traces_table_container, "style"),
|
|
||||||
Output(execution_time_histogram_container, "children"),
|
|
||||||
Output(parallel_coordinates, "figure"),
|
|
||||||
Output(parallel_coordinates, "style"),
|
|
||||||
Output(interval, "max_intervals"),
|
|
||||||
Input(table, "page_current"),
|
|
||||||
Input(table, "page_size"),
|
|
||||||
Input(table, "sort_by"),
|
|
||||||
Input(table, "filter_query"),
|
|
||||||
Input(interval, "n_intervals"),
|
|
||||||
)
|
|
||||||
def update_page(
|
|
||||||
page_current: int,
|
|
||||||
page_size: int,
|
|
||||||
sort_by: List[Dict[str, Union[str, int]]],
|
|
||||||
filter_query: str,
|
|
||||||
n_intervals: Optional[int],
|
|
||||||
) -> Tuple[
|
|
||||||
List[Dict[str, Any]],
|
|
||||||
int,
|
|
||||||
List[Dict[str, Sequence[str]]],
|
|
||||||
Dict[str, Any],
|
|
||||||
Any,
|
|
||||||
go.Figure,
|
|
||||||
Dict[str, Any],
|
|
||||||
int,
|
|
||||||
]:
|
|
||||||
conjunctive_filters = (
|
|
||||||
[get_filter_from_datatable(f) for f in filter_query.split(" && ")]
|
|
||||||
if filter_query
|
|
||||||
else []
|
|
||||||
)
|
|
||||||
non_null_conjunctive_filters = [f for f in conjunctive_filters if f is not None]
|
|
||||||
|
|
||||||
elements, count = get_context().tracing_database.query(
|
|
||||||
skip=page_current * page_size,
|
|
||||||
take=page_size,
|
|
||||||
conjunctive_filters=non_null_conjunctive_filters,
|
|
||||||
conjunctive_tags=[ONLINE_TAG_NAME],
|
|
||||||
sort_by=[SortBy.model_validate(s) for s in sort_by],
|
|
||||||
)
|
|
||||||
|
|
||||||
if non_null_conjunctive_filters:
|
|
||||||
all_elements, _ = get_context().tracing_database.query(
|
|
||||||
take=1, conjunctive_tags=[ONLINE_TAG_NAME]
|
|
||||||
)
|
|
||||||
else:
|
|
||||||
all_elements = elements
|
|
||||||
|
|
||||||
columns, style = update_layout(all_elements[0] if all_elements else None)
|
|
||||||
execution_time_histogram, parallel_coords_fig, parallel_style = update_charts(
|
|
||||||
elements=elements, accent_color=accent_color
|
|
||||||
)
|
|
||||||
|
|
||||||
return (
|
|
||||||
[
|
|
||||||
{k: str(v) for k, v in e.to_flat_dict(include_original=False).items()}
|
|
||||||
for e in elements
|
|
||||||
],
|
|
||||||
max(1, ceil(count / page_size)),
|
|
||||||
columns,
|
|
||||||
style,
|
|
||||||
execution_time_histogram,
|
|
||||||
parallel_coords_fig,
|
|
||||||
parallel_style,
|
|
||||||
((n_intervals or 0) + 1) if get_context().is_production else -1,
|
|
||||||
)
|
|
||||||
|
|
||||||
return app.server
|
|
||||||
|
|
||||||
|
|
||||||
def update_layout(
|
|
||||||
first_element: Optional[Trace],
|
|
||||||
) -> Tuple[List[Dict[str, Sequence[str]]], Dict[str, Any]]:
|
|
||||||
|
|
||||||
if first_element:
|
|
||||||
keys = list(first_element.to_flat_dict(include_original=False).keys())
|
|
||||||
header_height = max(len(i.split(":")) for i in keys)
|
|
||||||
columns = [
|
|
||||||
{
|
|
||||||
"name": [""] * (header_height - len(k.split(":")))
|
|
||||||
+ k.replace("_flat", "").split(":"),
|
|
||||||
"id": k,
|
|
||||||
}
|
|
||||||
for k in keys
|
|
||||||
]
|
|
||||||
else:
|
|
||||||
columns = []
|
|
||||||
|
|
||||||
return (
|
|
||||||
columns,
|
|
||||||
{"display": "none" if first_element is None else "block"},
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
def update_charts(
|
|
||||||
elements: List[Trace], accent_color: str
|
|
||||||
) -> Tuple[Any, go.Figure, Dict[str, Any]]:
|
|
||||||
if not elements:
|
|
||||||
return (
|
|
||||||
html.Span(
|
|
||||||
"No matching traces.",
|
|
||||||
className="placeholder",
|
|
||||||
),
|
|
||||||
go.Figure(),
|
|
||||||
{"display": "none"},
|
|
||||||
)
|
|
||||||
|
|
||||||
flat_elements = [e.to_flat_dict(include_original=False) for e in elements]
|
|
||||||
|
|
||||||
execution_time_histogram = dcc.Graph(config={"displaylogo": False})
|
|
||||||
df = pd.DataFrame(flat_elements)
|
|
||||||
fig = px.histogram(
|
|
||||||
df,
|
|
||||||
x="original_execution_time_ms",
|
|
||||||
labels={"original_execution_time_ms": "Execution time (ms)"},
|
|
||||||
nbins=20,
|
|
||||||
height=400,
|
|
||||||
log_y=True,
|
|
||||||
color_discrete_sequence=[accent_color],
|
|
||||||
)
|
|
||||||
fig.update_layout(
|
|
||||||
margin=dict(l=0, r=0, b=0, t=0, pad=0),
|
|
||||||
)
|
|
||||||
execution_time_histogram.figure = fig # type: ignore[attr-defined]
|
|
||||||
|
|
||||||
parallel_coords_fig = go.Figure(
|
|
||||||
go.Parcoords(
|
|
||||||
dimensions=[
|
|
||||||
get_dimension_descriptor(df, c)
|
|
||||||
for c in df.columns
|
|
||||||
if c not in {"trace_id", "created", "output", "exception", "feedback"}
|
|
||||||
and "_flat" not in c
|
|
||||||
],
|
|
||||||
line_color=accent_color,
|
|
||||||
)
|
|
||||||
)
|
|
||||||
return execution_time_histogram, parallel_coords_fig, {}
|
|
||||||
|
|
||||||
|
|
||||||
def get_dimension_descriptor(df: pd.DataFrame, column: str) -> Dict[str, Any]:
|
|
||||||
dimension: Dict[str, Any] = {
|
|
||||||
"label": snake_case_to_text(column),
|
|
||||||
}
|
|
||||||
|
|
||||||
values = df[column]
|
|
||||||
|
|
||||||
try:
|
|
||||||
dimension["values"] = [float(v) for v in values]
|
|
||||||
except (TypeError, ValueError):
|
|
||||||
MAX_LENGTH = 40
|
|
||||||
unique_values = unique(values, key=freeze)
|
|
||||||
value_mapping = {str(v)[:MAX_LENGTH]: i for i, v in enumerate(unique_values)}
|
|
||||||
|
|
||||||
dimension["values"] = [value_mapping[str(v)[:MAX_LENGTH]] for v in values]
|
|
||||||
dimension["tickvals"] = list(value_mapping.values())
|
|
||||||
dimension["ticktext"] = [k[:MAX_LENGTH] for k in value_mapping.keys()]
|
|
||||||
|
|
||||||
return dimension
|
|
||||||
|
|
@ -1,35 +0,0 @@
|
||||||
from dash import dcc, html
|
|
||||||
|
|
||||||
from ....helper import snake_case_to_text, strip_lines
|
|
||||||
|
|
||||||
|
|
||||||
def get_description(
|
|
||||||
function_name: str, version: str, function_docs: str, accent_color: str
|
|
||||||
) -> html.Div:
|
|
||||||
return html.Div(
|
|
||||||
[
|
|
||||||
html.H1(
|
|
||||||
[
|
|
||||||
f"{snake_case_to_text(function_name)} - dashboard",
|
|
||||||
html.Span(version, className="version-tag"),
|
|
||||||
],
|
|
||||||
style={"color": accent_color},
|
|
||||||
),
|
|
||||||
dcc.Markdown(
|
|
||||||
strip_lines(
|
|
||||||
f"""
|
|
||||||
> View the live data of your deployment here.
|
|
||||||
|
|
||||||
## Using the API
|
|
||||||
|
|
||||||
You can find the available endpoints at [/docs](/docs).
|
|
||||||
|
|
||||||
## Details
|
|
||||||
|
|
||||||
{function_docs}
|
|
||||||
"""
|
|
||||||
),
|
|
||||||
className="description",
|
|
||||||
),
|
|
||||||
]
|
|
||||||
)
|
|
||||||
|
|
@ -1,23 +0,0 @@
|
||||||
from typing import Optional, Union
|
|
||||||
|
|
||||||
from ....views import Filter, operators
|
|
||||||
|
|
||||||
|
|
||||||
def get_filter_from_datatable(description: str) -> Optional[Filter]:
|
|
||||||
for operator in operators:
|
|
||||||
if operator in description:
|
|
||||||
name_part, value_part = description.split(operator, 1)
|
|
||||||
value_part = value_part.strip()
|
|
||||||
name_part = name_part[name_part.find("{") + 1 : name_part.rfind("}")]
|
|
||||||
|
|
||||||
v0 = value_part[0]
|
|
||||||
if v0 == value_part[-1] and v0 in ("'", '"', "`"):
|
|
||||||
value: Union[str, float] = value_part[1:-1].replace("\\" + v0, v0)
|
|
||||||
else:
|
|
||||||
try:
|
|
||||||
value = float(value_part)
|
|
||||||
except ValueError:
|
|
||||||
value = value_part
|
|
||||||
return Filter(property=name_part, operator=operator, value=value)
|
|
||||||
|
|
||||||
return None
|
|
||||||