Skip to content
This repository was archived by the owner on Nov 22, 2022. It is now read-only.

Migrate create_predictor() to new data API #781

Closed
wants to merge 1 commit into from

Conversation

hudeven
Copy link
Contributor

@hudeven hudeven commented Jul 15, 2019

Summary:
issue in Github #701
root cause: create_predictor() is broken due to "features" is removed in the new Data API.
We generate a predictor by create_predictor() and feed the predictor with 1 row of data(typically raw_text in json) in each call. However, in the new API, we feed predictor with a batch of data. To migrate it to new API, We can either 1) construct a special single row batch and follow https://fburl.com/tp6ekiqa to get model_inputs or 2) generate the model_inputs in adhoc way

As I don't see an internal use case to predict with 1 row of data and approach 1) will take much efforts to implement(need to create a new Batcher to read data from a row of json input), I'm doing 2) in this diff.

Differential Revision: D16268791

@facebook-github-bot facebook-github-bot added the CLA Signed Do not delete this pull request or issue due to inactivity. label Jul 15, 2019
@hudeven hudeven force-pushed the export-D16268791 branch from afd6b0a to 45b0c11 Compare July 16, 2019 01:35
hudeven added a commit to hudeven/pytext that referenced this pull request Jul 16, 2019
Summary:
Pull Request resolved: facebookresearch#781

issue in Github facebookresearch#701
root cause: create_predictor() is broken due to "features" is removed in the new Data API.
We generate a predictor by create_predictor() and feed the predictor with 1 row of data(typically raw_text in json) in each call. However, in the new API, we feed predictor with a batch of data. To migrate it to new API, We can either 1) construct a special single row batch and follow https://fburl.com/tp6ekiqa to get model_inputs or 2) generate the model_inputs in adhoc way

As I don't see an internal use case to predict with 1 row of data and approach 1) will take much efforts to implement(need to create a new Batcher to read data from a row of json input), I'm doing 2) in this diff.

Differential Revision: D16268791

fbshipit-source-id: f0786fc692efddb0f423bcda78ccb7332d67ff15
@hudeven hudeven force-pushed the export-D16268791 branch from 45b0c11 to 3bd726e Compare July 16, 2019 01:37
hudeven added a commit to hudeven/pytext that referenced this pull request Jul 16, 2019
Summary:
Pull Request resolved: facebookresearch#781

issue in Github facebookresearch#701
root cause: create_predictor() is broken due to "features" is removed in the new Data API.
We generate a predictor by create_predictor() and feed the predictor with 1 row of data(typically raw_text in json) in each call. However, in the new API, we feed predictor with a batch of data. To migrate it to new API, We can either 1) construct a special single row batch and follow https://fburl.com/tp6ekiqa to get model_inputs or 2) generate the model_inputs in adhoc way

As I don't see an internal use case to predict with 1 row of data and approach 1) will take much efforts to implement(need to create a new Batcher to read data from a row of json input), I'm doing 2) in this diff.

Differential Revision: D16268791

fbshipit-source-id: 2f3583f2bc486407aa97fc69500b3f8d7f0e8ccb
@hudeven hudeven force-pushed the export-D16268791 branch from 3bd726e to 43027c4 Compare July 16, 2019 03:18
hudeven added a commit to hudeven/pytext that referenced this pull request Jul 16, 2019
Summary:
Pull Request resolved: facebookresearch#781

issue in Github facebookresearch#701
root cause: create_predictor() is broken due to "features" is removed in the new Data API.
We generate a predictor by create_predictor() and feed the predictor with 1 row of data(typically raw_text in json) in each call. However, in the new API, we feed predictor with a batch of data. To migrate it to new API, We can either 1) construct a special single row batch and follow https://fburl.com/tp6ekiqa to get model_inputs or 2) generate the model_inputs in adhoc way

As I don't see an internal use case to predict with 1 row of data and approach 1) will take much efforts to implement(need to create a new Batcher to read data from a row of json input), I'm doing 2) in this diff.

Differential Revision: D16268791

fbshipit-source-id: 194fc9e7b4f035ccfc7c41820a7060c810321c67
@hudeven hudeven force-pushed the export-D16268791 branch from 43027c4 to 557a01b Compare July 17, 2019 21:22
hudeven added a commit to hudeven/pytext that referenced this pull request Jul 17, 2019
Summary:
Pull Request resolved: facebookresearch#781

issue in Github facebookresearch#701
root cause: create_predictor() is broken due to "features" is removed in the new Data API.
We generate a predictor by create_predictor() and feed the predictor with 1 row of data(typically raw_text in json) in each call. However, in the new API, we feed predictor with a batch of data. To migrate it to new API, We can either 1) construct a special single row batch and follow https://fburl.com/tp6ekiqa to get model_inputs or 2) generate the model_inputs in adhoc way

As I don't see an internal use case to predict with 1 row of data and approach 1) will take much efforts to implement(need to create a new Batcher to read data from a row of json input), I'm doing 2) in this diff.

Reviewed By: Titousensei

Differential Revision: D16268791

fbshipit-source-id: 389e1ccd0177247517abb3c71d7f6e84dc3645fd
@hudeven hudeven force-pushed the export-D16268791 branch from 557a01b to 06afcf2 Compare July 17, 2019 22:54
hudeven added a commit to hudeven/pytext that referenced this pull request Jul 17, 2019
Summary:
Pull Request resolved: facebookresearch#781

issue in Github facebookresearch#701
root cause: create_predictor() is broken due to "features" is removed in the new Data API.
We generate a predictor by create_predictor() and feed the predictor with 1 row of data(typically raw_text in json) in each call. However, in the new API, we feed predictor with a batch of data. To migrate it to new API, We can either 1) construct a special single row batch and follow https://fburl.com/tp6ekiqa to get model_inputs or 2) generate the model_inputs in adhoc way

As I don't see an internal use case to predict with 1 row of data and approach 1) will take much efforts to implement(need to create a new Batcher to read data from a row of json input), I'm doing 2) in this diff.

Differential Revision: D16268791

fbshipit-source-id: 9945304f924ffa903b05b3b15b176b33c7dba5bd
@hudeven hudeven force-pushed the export-D16268791 branch from 06afcf2 to 1405038 Compare July 17, 2019 23:36
hudeven added a commit to hudeven/pytext that referenced this pull request Jul 17, 2019
Summary:
Pull Request resolved: facebookresearch#781

issue in Github facebookresearch#701
root cause: create_predictor() is broken due to "features" is removed in the new Data API.
We generate a predictor by create_predictor() and feed the predictor with 1 row of data(typically raw_text in json) in each call. However, in the new API, we feed predictor with a batch of data. To migrate it to new API, We can either 1) construct a special single row batch and follow https://fburl.com/tp6ekiqa to get model_inputs or 2) generate the model_inputs in adhoc way

As I don't see an internal use case to predict with 1 row of data and approach 1) will take much efforts to implement(need to create a new Batcher to read data from a row of json input), I'm doing 2) in this diff.

Reviewed By: Titousensei

Differential Revision: D16268791

fbshipit-source-id: dd311dec1b66ad025230582e933644ebd89e00cb
@hudeven hudeven force-pushed the export-D16268791 branch from 1405038 to 889c3dc Compare July 17, 2019 23:38
hudeven added a commit to hudeven/pytext that referenced this pull request Jul 17, 2019
Summary:
Pull Request resolved: facebookresearch#781

issue in Github facebookresearch#701
root cause: create_predictor() is broken due to "features" is removed in the new Data API.
We generate a predictor by create_predictor() and feed the predictor with 1 row of data(typically raw_text in json) in each call. However, in the new API, we feed predictor with a batch of data. To migrate it to new API, We can either 1) construct a special single row batch and follow https://fburl.com/tp6ekiqa to get model_inputs or 2) generate the model_inputs in adhoc way

As I don't see an internal use case to predict with 1 row of data and approach 1) will take much efforts to implement(need to create a new Batcher to read data from a row of json input), I'm doing 2) in this diff.

Reviewed By: Titousensei

Differential Revision: D16268791

fbshipit-source-id: 1b1da72021920dc32f022d64ee61f54f882fdbaa
Summary:
Pull Request resolved: facebookresearch#781

issue in Github facebookresearch#701
root cause: create_predictor() is broken due to "features" is removed in the new Data API.
We generate a predictor by create_predictor() and feed the predictor with 1 row of data(typically raw_text in json) in each call. However, in the new API, we feed predictor with a batch of data. To migrate it to new API, We can either 1) construct a special single row batch and follow https://fburl.com/tp6ekiqa to get model_inputs or 2) generate the model_inputs in adhoc way

As I don't see an internal use case to predict with 1 row of data and approach 1) will take much efforts to implement(need to create a new Batcher to read data from a row of json input), I'm doing 2) in this diff.

Reviewed By: Titousensei

Differential Revision: D16268791

fbshipit-source-id: 19b306d5d81aabea4321edebb577a9bbc4dcc96f
@facebook-github-bot
Copy link
Contributor

This pull request has been merged in c88959c.

@hudeven hudeven deleted the export-D16268791 branch April 6, 2020 23:51
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
CLA Signed Do not delete this pull request or issue due to inactivity. Merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants