Skip to content

Modified server to allow source features #2109

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Nov 4, 2021

Conversation

anderleich
Copy link
Contributor

This PR modifies the server to allow source features in the request.

Request example:

[{"id": 101, "src": "This is a test.", "src_feats": {"feat0": "A A A B", "feat1": "D D D F"}}]

It adds the InferFeatsTransform to the server to correctly manage features. Options from this transform can be set in the server configuration file:

{
    "models_root": "EXPERIMENT_dummy/models",
    "models": [
        {
            "id": 101,
            "model": "model_step_1000.pt",
            "timeout": 600,
            "on_timeout": "to_cpu",
            "load": true,
            "opt": {
                "gpu": 0
            },
            "tokenizer": {
                "type": "pyonmttok",
                "mode": "conservative",
                "params": {
                    "bpe_model_path": "codes.bpe",
                    "joiner": "■",
                    "joiner_annotate": true,
                    "case_markup": true,
                    "support_prior_joiners": true
                }
            },
            "features": {
                "reversible_tokenization": "joiner",
                "prior_tokenization": false
            }
        }
    ]
}

@anderleich anderleich changed the title Modified server to sallow source features Modified server to allow source features Oct 1, 2021
@anderleich anderleich marked this pull request as draft October 1, 2021 17:04
@anderleich anderleich marked this pull request as ready for review October 2, 2021 16:33
@anderleich
Copy link
Contributor Author

Hi @francoishernandez ,
Any news on this?

@francoishernandez
Copy link
Member

Sorry, this went a bit under my radar. I'll try and review this week.

@anderleich
Copy link
Contributor Author

Ok, great! Don't worry, that's what I thought ;)

@francoishernandez
Copy link
Member

Just had a quick look. Looks good. Please fix conflicts and then we'll merge.

@anderleich
Copy link
Contributor Author

Done

@francoishernandez francoishernandez merged commit 2d2445b into OpenNMT:master Nov 4, 2021
@anderleich anderleich deleted the server_allow_feats branch November 4, 2021 15:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants