semvec/pypi-packages huggingface dataset:
uni-grounding 0.0.3
A framework for developing a generic grounding module to boost semantic parsing
License: MIT License
Requires Python: >=3.7.0

# Grounding Module

## Training

### Data preparation
we need to provide raw training examples and their corresponding contexts as the input data for training.
Please refer to `TrainingRawExample` and `GroundingContext` in [contracts](./src/uni_grounding/core/contracts.py) for more details.

### Training grounding model with ETA algorithm
Please refer to `run_training_eta.sh` as a sample.

```
python training_eta.py \

```

### Inference
the input of inference pipeline is `GroundingRequest` in [contracts](./src/uni_grounding/core/contracts.py).

- Convert pytorch model to onnx: 'python convert_to_onnx.py -output_dir <output_dir>'
- load inference pipline : `pipeline = GroundingORTPipeline(onnx_model_path)`
- prepare request: `request = GroundingRequest.from_json(json_obj)`
- get result 'result = pipeline(request)'


## Package Release

### python

- build package
``` python setup.py sdist bdist_wheel ```

- upload
``` python -m twine upload --repository-url https://pkgs.dev.azure.com/deyang/_packaging/grounding/pypi/upload/ dist/* ```

- install
``` pip install uni-grounding --index-url=https://pkgs.dev.azure.com/deyang/_packaging/grounding/pypi/simple/ ```