GVKun编程网logo

成功解决 label_error >= 0 && label_error < static_cast<int>(nclass) MultiClassEvaluation: label must be i

8

本文将为您提供关于成功解决label_error>=0&&label_error<static_cast<int>(nclass)MultiClassEvaluation:labelmustbei的详

本文将为您提供关于成功解决 label_error >= 0 && label_error < static_cast<int>(nclass) MultiClassEvaluation: label must be i的详细介绍,同时,我们还将为您提供关于 {{=val.nickname}}、Amazon Comprehend now supports multi-label custom classification、amazon-web-services – Multi Docker Elastic Beanstalk:上传.ebextensions、amazon-web-services – 为什么我得到ElasticBeanstalk :: ExternalInvocationError?的实用信息。

本文目录一览:

成功解决 label_error >= 0 && label_error < static_cast<int>(nclass) MultiClassEvaluation: label must be i

成功解决 label_error >= 0 && label_error < static_cast<int>(nclass) MultiClassEvaluation: label must be i

成功解决 label_error >= 0 && label_error <static_cast<int>(nclass) MultiClassEvaluation: label must be in [0, num_class), num_class=1 but found 1 in label''

 

 

 

目录

解决问题

解决思路

解决方法


 

 

 

 

解决问题

label_error >= 0 && label_error < static_cast<int>(nclass) MultiClassEvaluation: label must be in [0, num_class), num_class=1 but found 1 in label''

 

 

<

{{=val.nickname}}" alt=" {{=val.nickname}}">

{{=val.nickname}}"> {{=val.nickname}}

我想用 jquery 获取这段 a 标签里面的 user_id 的值    $(''a'').attr (''user_id'') 这样写拿不到   该怎么写啊

Amazon Comprehend now supports multi-label custom classification

Amazon Comprehend now supports multi-label custom classification

https://amazonaws-china.com/blogs/machine-learning/amazon-comprehend-now-supports-multi-label-custom-classification/


Amazon Comprehend is a fully managed natural language processing (NLP) service that enables text analytics to extract insights from the content of documents. Amazon Comprehend supports custom classification and enables you to build custom classifiers that are specific to your requirements, without the need for any ML expertise. Previously, custom classification supported multi-class classification, which is used to assign a single label to your documents from a list of mutually exclusive labels. Starting January 6, custom classification also supports multi-label classification. With multi-label classification you can train models and classify your documents with more than one label.

For example, you can use multi-label classification to categorize customer contact transcripts with one or more labels to identify departments within your company like Payments, Renewals or Tech Support. These labels can then be mapped to relevant content in your support library or directed towards the appropriate contacts within your company.

In this post, let’s take a look at how to predict the subjects of an academic paper based on the abstract (data source: Yang et al. 2018. Sequence Generation Model for Multi-Label Classification). Custom classification is a two-step process. First you train a custom classifier to recognize the labels that are of interest to you. In the image below we’ve created a CSV file with abstracts and the applicable labels on each row:

You can download a subsample of the dataset above in Comprehend supported input format at comprehend_multilabel.zip.

Next we train the classifier in the Amazon Comprehend console. We choose multi-label mode, point to the S3 location where the training data is stored and manage other settings. See detailed instructions in the developer guide:

In the second step of custom classification, after Amazon Comprehend trains the classifier, you send unlabeled documents to be classified using the console or StartDocumentClassificationJob API. For our example, we will run an inference with a file that has one document per line:

Depending on whether you trained a multi-class or multi-label custom classifier, the classification API examines each document and returns either the specific label that best represents the content (multi-class) or the set of labels that best represent it (multi-label). For our analysis job, we get an output as shown below:

Here’s a detailed look at one line:

The output identifies all the subjects that apply to each abstract and their associated scores.

You can also create an endpoint with your custom multi-label classifier to enable real-time applications. Learn more about creating an endpoint for synchronous inference here.

Amazon Comprehend multi-label classification is now available in all AWS regions where Amazon Comprehend is available. To try the new feature, log in to the Amazon Comprehend console for a code-free experience, or download the AWS SDK. You can also learn more about this new feature in the documentation.

The dataset used in this post is a redacted, subsampled, and reformatted version of the AAPD dataset made available as part of Yang et al. 2018. Sequence Generation Model for Multi-Label Classification which is licensed under CC BY 4.0. A copy of the license is available here.


About the Author

Sameer Karnik is a Sr. Product Manager leading product for Amazon Comprehend, AWS’s natural language processing service.

 

 

 

 

amazon-web-services – Multi Docker Elastic Beanstalk:上传.ebextensions

amazon-web-services – Multi Docker Elastic Beanstalk:上传.ebextensions

是否可以将.ebextensions部署到Multi-Docker Elastic Beanstalk?

我使用Dockerrun.aws.json文件上传我的应用程序,一切正常.我想设置日志以流式传输到Cloudwatch.我应该使用.ebextensions做到这一点.但是,如果我只在网络浏览器(AWS控制台)上传Dockerrun.aws.json(不是.zip或.war),我不知道如何附加.ebextensions.

>我如何将.ebxetensions部署到Multi Docker Elastic Beanstalk?
> …或者是否可以设置哪些日志应该流式传输到Cloudwatch日志?

最佳答案
您应该创建一个zip存档,其中包含Dockerrun.aws.json和.ebextensions目录以及您需要的任何配置文件.

Elastic Beanstalk将从存档中找到Dockerrun.aws.json文件.

这在AWS’Multicontainer Docker tutorial中有所涉及.

amazon-web-services – 为什么我得到ElasticBeanstalk :: ExternalInvocationError?

amazon-web-services – 为什么我得到ElasticBeanstalk :: ExternalInvocationError?

我的应用程序构建在RubyOnRails上,并使用乘客部署为弹性beanstalk应用程序,我正在尝试将标头添加到Nginx服务器并重新启动它,这是我的配置文件,来自aws弹性beanstalk的.ebextensions文件夹中的脚本:

packages: 
    yum:
        Nginx: [] 

files:
    "/etc/Nginx/conf.d/webapp.conf" :
        mode: "000644"
        owner: root
        group: root
        content: |
            server {

                location /assets {
                  alias /var/app/current/public/assets;
                  gzip_static on;
                  gzip on;
                  expires max;
                  add_header Cache-Control public;
                }

                location /public {
                  alias /var/app/current/public;
                  gzip_static on;
                  gzip on;
                  expires max;
                  add_header Cache-Control public;
                }

            }

# This reloads the server,which will both make the changes take affect and makes sure the config is valid when you deploy
container_commands:
  01_reload_Nginx:
    command: "sudo service Nginx reload"

但是我收到了这个错误:

[2017-12-13T06:23:48.635Z] ERROR [17344] : Command CMD-AppDeploy Failed!
[2017-12-13T06:23:48.635Z] INFO  [17344] : Command processor returning results: 
{"status":"FAILURE","api_version":"1.0","results":[{"status":"FAILURE","msg":"container_command 01_reload_Nginx in .ebextensions/01_elastic_beanstalk_webapp.config Failed. For more detail,check /var/log/eb-activity.log using console or EB CLI","returncode":7,"events":[]}]}

/var/log/eb-activity.log:

[2017-12-13T06:23:48.584Z] INFO  [17344] - [Application update fix-command-Nginx-reload-hope@2/AppDeployStage0/EbExtensionPostBuild/Infra-EmbeddedPostBuild/postbuild_0_myapp_website/Command 01_reload_Nginx] : Starting activity...
[2017-12-13T06:23:48.619Z] INFO  [17344] - [Application update fix-command-Nginx-reload-hope@2/AppDeployStage0/EbExtensionPostBuild/Infra-EmbeddedPostBuild/postbuild_0_myapp_website/Command 01_reload_Nginx] : Activity execution Failed,because:  (ElasticBeanstalk::ExternalInvocationError)


[2017-12-13T06:23:48.619Z] INFO  [17344] - [Application update fix-command-Nginx-reload-hope@2/AppDeployStage0/EbExtensionPostBuild/Infra-EmbeddedPostBuild/postbuild_0_myapp_website/Command 01_reload_Nginx] : Activity Failed.

虽然如果我ssh到实例并执行sudo服务Nginx重新加载它将正常执行..
任何的想法?

编辑

$cat /proc/version
Linux version 4.9.43-17.39.amzn1.x86_64 (mockbuild@gobi-build-64011) (gcc version 4.8.3 20140911 (Red Hat 4.8.3-9) (GCC) ) #1 SMP Fri Sep 15 23:39:41 UTC 2017

部署命令:

eb deploy my-app -v

请求资产的标题:

Connection: keep-alive
content-encoding: gzip
Content-Type: application/x-javascript
Date: Fri,24 Aug 2018 11:03:50 GMT
ETag: W/"12cd8ea0-20db3"
Last-Modified: Mon,31 Dec 1979 04:08:00 GMT
Server: Nginx/1.12.1
transfer-encoding: chunked
Via: 1.1 8cc9957dff77c27e9931ab0aaf344ec9.cloudfront.net (CloudFront)
X-Amz-Cf-Id: 0NlE-figgzczadHYeK7HMMsDsGRmaB8Sefvo89phHWw3LSx01t5rgQ==
X-Cache: Miss from cloudfront

缺少标题:

   access-control-max-age: 3000
   age: 48214

服务器上的更新conf文件

$cat /etc/Nginx/conf.d/webapp.conf
server {

    location /assets {
      alias /var/app/current/public/assets;
      gzip_static on;
      gzip on;
      expires max;
      add_header Cache-Control public;
      add_header 'Access-Control-Allow-Origin' '*';
    }

    location /public {
      alias /var/app/current/public;
      gzip_static on;
      gzip on;
      expires max;
      add_header Cache-Control public;
      add_header 'Access-Control-Allow-Origin' '*';
    }

}

编辑

service Nginx configtest结果:

$sudo service Nginx configtest
Nginx: the configuration file /etc/Nginx/Nginx.conf Syntax is ok
Nginx: configuration file /etc/Nginx/Nginx.conf test is successful
最佳答案
命令:“sudo service Nginx reload”不是必需的,因为Nginx服务在每次成功部署后自动重启.您可以从配置文件中删除它.

您可能会遇到CDN服务到期的延迟,请尝试刷新缓存或直接对EB网址进行测试.

今天关于成功解决 label_error >= 0 && label_error < static_cast<int>(nclass) MultiClassEvaluation: label must be i的讲解已经结束,谢谢您的阅读,如果想了解更多关于 {{=val.nickname}}、Amazon Comprehend now supports multi-label custom classification、amazon-web-services – Multi Docker Elastic Beanstalk:上传.ebextensions、amazon-web-services – 为什么我得到ElasticBeanstalk :: ExternalInvocationError?的相关知识,请在本站搜索。

本文标签: