pg2s metric implementation
Project description
PG2S
A full Python library for the PG2S metric (paper).
Quickstart
Clone & Install
git clone https://github.com/Lab-RoCoCo-Sapienza/pg2s
cd pg2s
pip install .
or from pip:
pip install pg2s
Usage
To use the pg2s_score, you need to define:
- a tuple of list tuples, containing the tasks and for each of them the truth and prediction actions;
- an hyperparameter alpha that can be tuned to give more importance to the goal-wise similarity or to the sentence-wise similarity. Default value is 0.5 Here is how to call the function in your Python code:
from pg2s.metric import pg2s_score
plans = {
"name-task-1": {
'truth':[
'Action 1',
'Action 2',
...
'Action N'
],
'predict':[
'Action 1',
'Action 2',
...
'Action M'
]
},
}
# Calculate the similarity score with a custom alpha value
score = pg2s_score(plans, alpha=0.7)
print(f"PG2S Score: {score}")
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pg2s-0.1.0.tar.gz
(7.3 kB
view details)
Built Distribution
pg2s-0.1.0-py3-none-any.whl
(7.7 kB
view details)
File details
Details for the file pg2s-0.1.0.tar.gz
.
File metadata
- Download URL: pg2s-0.1.0.tar.gz
- Upload date:
- Size: 7.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 321bb25f40b24c195b1631693e8b2f026716190a3ff298655d4313a0c6e97b7a |
|
MD5 | 6a48df350e3cad2a4522d9f97e10166f |
|
BLAKE2b-256 | f351dc48bd32952a10587657a9aadc87eff5828a45349157ad0082705c19aa37 |
File details
Details for the file pg2s-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: pg2s-0.1.0-py3-none-any.whl
- Upload date:
- Size: 7.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 223fe4a927a1a2df8865e43d881bd454cca3f81003bac86687579189f6ebf936 |
|
MD5 | 9f4d9927b04fd7d0e8db66e77cb13230 |
|
BLAKE2b-256 | 4c6987cc79838b609bed92c1f6f60c7946da8a9d7d58388b2f799b9c0cfd22ef |