-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #40 from 6gsn/introduce/marine
Introduce marine
- Loading branch information
Showing
8 changed files
with
222 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,3 +25,5 @@ Misc | |
---- | ||
|
||
.. autofunction:: run_frontend | ||
.. autofunction:: make_label | ||
.. autofunction:: estimate_accent |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.