Skip to content

Commit 8c7efdf

Browse files
committed
Merge branch 'develop' of github.com:strangetom/ingredient-parser into develop
2 parents 8489c8f + 1d8c045 commit 8c7efdf

File tree

272 files changed

+14384
-1942
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

272 files changed

+14384
-1942
lines changed

.pre-commit-config.yaml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,26 +5,52 @@ repos:
55
rev: v5.0.0
66
hooks:
77
- id: check-added-large-files
8+
name: (base:repo) debug-statements
89
args: ['--maxkb=5000']
910
stages: [pre-commit]
1011
- id: check-ast
12+
name: (base:repo) check-ast
1113
stages: [pre-commit]
1214
- id: check-toml
15+
name: (base:repo) check-toml
1316
stages: [pre-commit]
1417
- id: check-yaml
18+
name: (base:repo) check-yaml
1519
stages: [pre-commit]
1620
- id: debug-statements
21+
name: (base:repo) debug-statements
1722
stages: [pre-commit]
1823
- repo: https://github.com/astral-sh/ruff-pre-commit
1924
rev: v0.11.6
2025
hooks:
2126
- id: ruff
27+
name: (base:repo) ruff
2228
args: ["--fix"]
2329
stages: [pre-commit]
2430
- id: ruff-format
31+
name: (base:repo) ruff-format
2532
stages: [pre-commit]
2633
- repo: https://github.com/sphinx-contrib/sphinx-lint
2734
rev: v1.0.0
2835
hooks:
2936
- id: sphinx-lint
37+
name: (docs:repo) sphinx-lint
3038
stages: [pre-commit]
39+
- repo: local
40+
hooks:
41+
- id: biome-check-ts-js
42+
name: (webtools:repo) biome check typescript/javascript
43+
entry: npx @biomejs/biome check --write ./webtools/src --config-path=./webtools/biome.json --files-ignore-unknown=true --no-errors-on-unmatched
44+
language: node
45+
types: [text]
46+
files: "\\.(jsx?|tsx?|c(js|ts)|m(js|ts)|d\\.(ts|cts|mts)|jsonc?)$"
47+
exclude: ^docs/
48+
require_serial: true
49+
- id: biome-check-css
50+
name: (webtools:repo) biome check css
51+
entry: npx @biomejs/biome check --write ./webtools/src --config-path=./webtools/biome.json --files-ignore-unknown=true --no-errors-on-unmatched
52+
language: node
53+
types: [text]
54+
files: "\\.(css?)$"
55+
exclude: ^docs/
56+
require_serial: true

README.md

Lines changed: 27 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,9 @@ Word-level results:
5959

6060
## Development
6161

62-
The development dependencies are in the ```requirements-dev.txt``` file. Details on the training process can be found in the [Model Guide](https://ingredient-parser.readthedocs.io/en/latest/guide/index.html) documentation.
62+
**Basic**
63+
64+
The development dependencies are in the `requirements-dev.txt` file. Details on the training process can be found in the [Model Guide](https://ingredient-parser.readthedocs.io/en/latest/guide/index.html) documentation.
6365

6466
Before committing anything, install [pre-commit](https://pre-commit.com/) and run
6567
```
@@ -68,16 +70,34 @@ pre-commit install
6870

6971
to install the pre-commit hooks.
7072

71-
Please target the **develop** branch for pull requests. The main branch is used for stable releases and hotfixes only.
73+
**Web app**
7274

73-
There is a simple web app for testing the parser with ingredient sentences and showing the parsed output. To run the web app, run the command
75+
There is a simple web app for testing the parser, browsing the database, labelling entries, and running the basic model.
76+
77+
To run the web app, follow the prior steps on `requirements-dev.txt`, and separately install [Node](https://nodejs.org/en/download), the JS runtime. Once globally installed on your machine, download your packages in the webtools directory with:
78+
79+
```bash
80+
$ npm install
81+
```
82+
83+
After package installs, run dev to start.
7484

7585
```bash
76-
$ flask --app webapp run
86+
$ npm run dev
7787
```
7888

79-
![Screen shot of web app](docs/source/_static/app-screenshot.png)
89+
*tl;dr — inside package.json, `flask` runs the base server, `sockets` runs the web sockets server, and `watch` runs vite build for the react/typescripe bundle — separate flask instances are required to accommodate better web socket behavior*
90+
91+
![Screen shot of web parser](docs/source/_static/app.parser.screenshot.png)
92+
![Screen shot of web labeller](docs/source/_static/app.labeller.screenshot.png)
93+
![Screen shot of web trainer](docs/source/_static/app.trainer.screenshot.png)
94+
95+
**Documentation**
96+
97+
The dependencies for building the documentation are in the `requirements-doc.txt` file.
8098

81-
This requires the development dependencies to be installed.
99+
**Contribution**
82100

83-
The dependencies for building the documentation are in the ```requirements-doc.txt``` file.
101+
Please target the **develop** branch for pull requests. The main branch is used for stable releases and hotfixes only.
102+
103+
There is a simple web app for testing the parser with ingredient sentences and showing the parsed output. To run the web app, run the command
84.2 KB
Loading
63.1 KB
Loading
91.2 KB
Loading

docs/source/_static/logo_source.svg

Lines changed: 1 addition & 279 deletions
Loading

docs/source/how-to/extending.rst

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -128,16 +128,15 @@ Depending on the language, you may need a language specific :func:`tokenize <ing
128128

129129
.. tip::
130130

131-
A web app has been developed to aid in the adding and labelling of training sentences. Run the command
131+
A web app has been developed to aid in the adding and labelling of training sentences. If intending to add another language, you will need to adjust some of the web app code. Regardless, you can run these commands under the webtools directory to install the packages and run the web app.
132132

133133
.. code:: bash
134134
135-
$ flask --app labeller run
135+
$ npm install
136+
$ npm run dev
136137
137138
Then navigate to http://localhost:5000 in your browser.
138139

139-
You may need to tweak this to work with the correct database.
140-
141140
1. Normalise
142141
~~~~~~~~~~~~
143142

0 commit comments

Comments
 (0)