Download code/ja_ext/pyopenjtalk/utils.py from IndexTeam/Index-Echo-S2ST-9B: direct link, hf CLI and curl.
- Browser
- Download file 835 Bytes
-
https://huggingface.co/IndexTeam/Index-Echo-S2ST-9B/resolve/main/code/ja_ext/pyopenjtalk/utils.py
- Command line
-
hf download hf://IndexTeam/Index-Echo-S2ST-9B/code/ja_ext/pyopenjtalk/utils.py
-
curl -L -o utils.py https://huggingface.co/IndexTeam/Index-Echo-S2ST-9B/resolve/main/code/ja_ext/pyopenjtalk/utils.py
835 Bytes
| def merge_njd_marine_features(njd_features, marine_results): | |
| features = [] | |
| marine_accs = marine_results["accent_status"] | |
| marine_chain_flags = marine_results["accent_phrase_boundary"] | |
| assert ( | |
| len(njd_features) == len(marine_accs) == len(marine_chain_flags) | |
| ), "Invalid sequence sizes in njd_results, marine_results" | |
| for node_index, njd_feature in enumerate(njd_features): | |
| _feature = {} | |
| for feature_key in njd_feature.keys(): | |
| if feature_key == "acc": | |
| _feature["acc"] = int(marine_accs[node_index]) | |
| elif feature_key == "chain_flag": | |
| _feature[feature_key] = int(marine_chain_flags[node_index]) | |
| else: | |
| _feature[feature_key] = njd_feature[feature_key] | |
| features.append(_feature) | |
| return features | |