AcroLearner

FREE
By Samurai | Updated एक महीने पहले | Artificial Intelligence/Machine Learning
Health Check

N/A

Back to All Tutorials (8)

Description and Examples for AcroLearner Learning Item

AcroLearner is a set of Machine Learning RESTful APIs including TextClassification(Naive Bayes Classifier Model) for Natural Language Processing, Linear Regression Prediction, Logistic Regression Classification and Time Seris Prediction. Generally, the following steps is necessary.

  1. First of all, a new Machine Learning Theme is posted with some parameters and its items or not. You will get "trainKey" and “resultKey”.
    "trainKey" is unique only for this theme. “resultKey” is changeable. Actually a different “resultKey” will available when you call the Theme every time.

  2. Then you may individually post or put some items of the theme above.

  3. Once you finish the registration of Machine Learning Theme and its items, you may start a training/learning process to generate a Machine Learning Model using “trainKey”.

  4. Finally, you may post your original data to Machine Learning Model above and get the result of Classification/Prediction using “resultKey”.

*Only Japanese morphological analysis is processed, other alphabet languages should be partially supported.
*Test data for Text Classification
https://www.kaggle.com/uciml/sms-spam-collection-dataset
*Test data for Linear Regression Prediction
http://lib.stat.cmu.edu/datasets/boston
*Test data for Logistic Regression Classification
https://archive.ics.uci.edu/ml/machine-learning-databases/iris/

##0201. Get Learning Item List
Get the items list of a specified Learning Theme.
https://acrolearner.p.rapidapi.com/AcroLearner/v0_1/CltService/ml/trains/{trainKey}/items
http method: get

Request Header parameters:

x-rapidapi-host: acrolearner.p.rapidapi.com
x-rapidapi-key: [your rapidapi-key]

Request Path parameters:

{trainKey}: XXXXXXXXXX

Request Query parameters:

category=&order=&offset=&rowcount=&statusId=1

category: (option) Training/Learning Item Classification as a search condition
order: (option) the order for list
offset: (option) the offset for list
rowcount: (option) the rowcount for list
statusId: (option) as a search condition, 0(default): new, 1: permitted, 2: logically deleted, 99: all

Response JSON Example:

-Linear Single Regression Prediction successful case:

{
    "contents": {
        "code": "0000",
        "entities": [
            {
                "category": "RM",
                "createDT": "2021-10-24 19:49:40.0",
                "itemNo": 1,
                "memo": "Test",
                "trainId": 10017,
                "trainText": "6.575 6.421 7.185 6.998 7.147 6.43 6.012 6.172 5.631 6.004 6.377 6.009 5.889 5.949 6.096 5.834 5.935 5.99 5.456 ...... 6.593 6.12 6.976 6.794 6.03",
                "updateDT": "2021-10-24 19:49:40.0"
            },
            {
                "category": "MEDV",
                "createDT": "2021-10-24 19:49:40.0",
                "itemNo": 2,
                "memo": "Test",
                "trainId": 10017,
                "trainText": "24 21.6 34.7 33.4 36.2 28.7 22.9 27.1 16.5 18.9 15 18.9 21.7 20.4 18.2 19.9 23.1 17.5 20.2 18.2 13.6 ...... 16.8 22.4 20.6 23.9 22 11.9",
                "updateDT": "2021-10-24 19:49:40.0"
            }
        ],
        "message": "Successful!",
        "nextCursor": 2,
        "size": 0
    },
    "errors": null,
    "memo": "Congratulations on your success!",
    "result": true
}

##0202. Get Learning Item CSV
Get the items csv of a specified Learning Theme.
https://acrolearner.p.rapidapi.com/AcroLearner/v0_1/CltService/ml/trains/{trainKey}/items/csv
http method: get

Request Header parameters:

x-rapidapi-host: acrolearner.p.rapidapi.com
x-rapidapi-key: [your rapidapi-key]

Request Path parameters:

{trainKey}: XXXXXXXXXX

Request Query parameters:

category=&order=&offset=&rowcount=&statusId=1

category: (option) Training/Learning Item Classification as a search condition
order: (option) the order for list
offset: (option) the offset for list
rowcount: (option) the rowcount for list
statusId: (option) as a search condition, 0(default): new, 1: permitted, 2: logically deleted, 99: all

Response CSV Example:

Linear Single Regression Prediction successful case

10017,1,RM,Test,2021-10-24 19:49:40.0,2021-10-24 19:49:40.0
10017,2,MEDV,Test,2021-10-24 19:49:40.0,2021-10-24 19:49:40.0

##0203. Get Learning Item
Get an Item property of a specified Learning Theme.
https://acrolearner.p.rapidapi.com/AcroLearner/v0_1/CltService/ml/trains/{trainKey}/items/{itemNo}
http method: get

Request Header parameters:

x-rapidapi-host: acrolearner.p.rapidapi.com
x-rapidapi-key: [your rapidapi-key]

Request Path parameters:

{trainKey}: XXXXXXXXXX
{itemNo}: 1

Response JSON Example:

-Linear Single Regression Prediction successful case:

{
    "contents": {
        "category": "RM",
        "createDT": "2021-10-24 19:49:40.0",
        "itemNo": 1,
        "memo": "Test",
        "trainId": 10017,
        "trainText": "6.575 6.421 7.185 6.998 7.147 6.43 6.012 6.172 5.631 6.004 6.377 6.009 5.889 5.949 6.096 5.834 ...... 6.027 6.593 6.12 6.976 6.794 6.03",
        "updateDT": "2021-10-24 19:49:40.0"
    },
    "errors": null,
    "memo": "Congratulations on your success!",
    "result": true
}

##0204. Add Learning Theme Item
Add new Items for a specified Learning Theme. Multiple items can be kept in a same category.
https://acrolearner.p.rapidapi.com/AcroLearner/v0_1/CltService/ml/trains/{trainKey}/items
http method: post

Request Header parameters:

Content-Type: application/json
x-rapidapi-host: acrolearner.p.rapidapi.com
x-rapidapi-key: [your rapidapi-key]

Request Path parameters:

{trainKey}: XXXXXXXXXX

Request JSON Example:

Text Classification case

{
    "contents": [
        {
            "category": "Standard Poodle",
            "createDT": "2021-10-25 00:18:49.642",
            "itemNo": 1,
            "memo": "Test",
            "trainId": 10009,
            "trainText": "Original size poodle. Originally used as a retriever to collect birds shot down by her husband. Currently, he is also active as a service dog. A medium-sized dog with a height of 45-60 cm and a weight of 15-19 kg.",
            "updateDT": "2021-10-25 00:18:49.642"
        },
        {
            "category": "Medium poodle",
            "createDT": "2021-10-25 00:18:49.644",
            "itemNo": 2,
            "memo": "Test",
            "trainId": 10009,
            "trainText": "A poodle of a size recently designated to eliminate overcrowding in dog shows. Although it is certified by the FCI and the Japan Kennel Club (JKC) that follows this, confusion has occurred because many countries do not specify the medium size. A medium-sized dog with a height of 35-45 cm and a weight of 8-15 kg.",
            "updateDT": "2021-10-25 00:18:49.644"
        },
        {
            "category": "Miniature Poodle",
            "createDT": "2021-10-25 00:18:49.648",
            "itemNo": 3,
            "memo": "Test",
            "trainId": 10009,
            "trainText": "A miniaturized version of the standard size that is easy to keep in order to prepare art in the circus or at home. It is not very familiar in Japan, but it is very popular in the United States. A small dog with a height of 28-35 cm and a weight of 5-8 kg.",
            "updateDT": "2021-10-25 00:18:49.648"
        },
        {
            "category": "toy poodle",
            "createDT": "2021-10-25 00:18:49.651",
            "itemNo": 4,
            "memo": "Test",
            "trainId": 10009,
            "trainText": "A smaller version of the Miniature Poodle to keep it purely as a pet dog. At first, malformations often appeared, but as a result of the improvement, the quality of the dog became stable. A small dog with a height of 26-28 cm and a weight of around 3 kg.",
            "updateDT": "2021-10-25 00:18:49.651"
        }
    ],
    "errors": null,
    "memo": "Congratulations on your success!",
    "result": true
}
  • For NaivebayesTextClassification: category is required to input here, and Multiple items can be kept in a same category.
  • For Linear Repression Prediction: at least two items are required, put a numerical string in trainText which are separated with spaces, the splitting count of every string is identical. The numerical string in the last trainText is the true value.
  • For Logistic Repression Classification: at least two items are required. The classification values is stored in the last trainText, and they can be a character strings. These numerical strings or character string in trainText are separated with spaces, the splitting count of every strings is identical.
  • For Time Series Prediction: only a trainText is required. put a numerical string in trainText which are separated with spaces.

##0205. Update Learning Theme Item
Update some items of a specified Learning Theme. Multiple items can be saved in a same category.
https://acrolearner.p.rapidapi.com/v0_1/CltService/ml/trains/{trainKey}/items
http method: put

Request Header parameters:

Content-Type: application/json
x-rapidapi-host: acrolearner.p.rapidapi.com
x-rapidapi-key: [your rapidapi-key]

Request Path parameters:

{trainKey}: XXXXXXXXXX

Request Query parameters:

nullable=false
nullable: true: even null item will be updated, false(default): null item will be not update.

Request JSON Example:

Text Classification case

[
        {
            "category": "Standard Poodle",
            "itemNo": 1,
            "memo": "Test",
            "trainText": "Original size poodle. Originally used as a retriever to collect birds shot down by her husband. Currently, he is also active as a service dog. A medium-sized dog with a height of 45-60 cm and a weight of 15-19 kg."
        },
        {
            "category": "Medium poodle",
            "itemNo": 2,
            "memo": "Test",
            "trainText": "A poodle of a size recently designated to eliminate overcrowding in dog shows. Although it is certified by the FCI and the Japan Kennel Club (JKC) that follows this, confusion has occurred because many countries do not specify the medium size. A medium-sized dog with a height of 35-45 cm and a weight of 8-15 kg."
        },
        {
            "category": "Miniature Poodle",
            "itemNo": 3,
            "memo": "Test",
            "trainText": "A miniaturized version of the standard size that is easy to keep in order to prepare art in the circus or at home. It is not very familiar in Japan, but it is very popular in the United States. A small dog with a height of 28-35 cm and a weight of 5-8 kg."
        },
        {
            "category": "toy poodle",
            "itemNo": 4,
            "memo": "Test",
            "trainText": "A smaller version of the Miniature Poodle to keep it purely as a pet dog. At first, malformations often appeared, but as a result of the improvement, the quality of the dog became stable. A small dog with a height of 26-28 cm and a weight of around 3 kg."
        }
]
  • For NaivebayesTextClassification: category is required to input here, and Multiple items can be kept in a same category.
  • For Linear Repression Prediction: at least two items are required, put a numerical string in trainText which are separated with spaces, the splitting count of every string is identical. The numerical string in the last trainText is the true value.
  • For Logistic Repression Classification: at least two items are required. The classification values is stored in the last trainText, and they can be a character strings. These numerical strings or character string in trainText are separated with spaces, the splitting count of every strings is identical.
  • For Time Series Prediction: only a trainText is required. put a numerical string in trainText which are separated with spaces.

Response JSON Example:

{
    "contents": {
        "code": "0000",
        "list": null,
        "message": "Congratulations on your success!",
        "subject": "updateMLTrainItem"
    },
    "errors": null,
    "memo": "",
    "result": true
}

“result”: true: successful, false: failed

##0206. Delete Learning Theme Item
delete a Learning Theme Item. In order to delete the item, the theme’s “statusId” should be set to 2 in advance in 0105. Set Learning Theme Status.
https://acrolearner.p.rapidapi.com/AcroLearner/v0_1/CltService/ml/trains/{trainKey}/items/{itemNos}
http method: delete

Request Header parameters:

x-rapidapi-host: acrolearner.p.rapidapi.com
x-rapidapi-key: [your rapidapi-key]

Request Path parameters:

{trainKey}: XXXXXXXXXX
{itemNos}: 1,2

Response JSON Example:

{
    "contents": {
        "code": "0000",
        "list": null,
        "message": "Congratulations on your success!",
        "subject": "deleteMLTrainItems"
    },
    "errors": null,
    "memo": "",
    "result": true
}