【问题标题】:Sample application using AlchemyAPI使用 AlchemyAPI 的示例应用程序
【发布时间】:2016-01-11 13:35:04
【问题描述】:

我尝试了示例 Java 程序来为文本文件调用以下 Alchemy API。

  TextGetRankedNamedEntities
  TextGetRankedConcepts
  TextGetRankedKeywords
  TextGetLanguage
  TextGetCategory
  TextGetTextSentiment 
  TextGetTargetedSentiment
  TextGetRelations     
  TextGetCombined     
  TextGetTaxonomy  

个别结果看起来不错。但是有没有使用这些 API 的示例 Java 应用程序?展示如何使用 AlchemyAPI 提供的 XML 来推断有意义的业务洞察力。

【问题讨论】:

    标签: alchemyapi


    【解决方案1】:

    Watson Developer Cloud Java SDK 支持 AlchemyAPI,它使用对象而不是返回 XML,因此很容易与现有 Java 应用程序集成。

    例如,下面的代码使用 AlchemyVision API 来识别图像中的人脸。

    AlchemyVision service = new AlchemyVision();
    service.setApiKey("<api_key>");
    
    File image = new File("obama.jpg");
    ImageFaces faces = service.recognizeFaces(image, true);
    
    System.out.println(faces); 
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-08-30
      • 2014-11-12
      • 2019-01-22
      • 1970-01-01
      • 2023-03-28
      • 1970-01-01
      • 1970-01-01
      • 2012-07-19
      相关资源
      最近更新 更多