Giter Site home page Giter Site logo

baidubec_api's Introduction

baidubec_api

百度天智一些人工智能 api 的Java 封装,多线程请求,并且可以传入多个access key 信息 Edit Add topics,通过多组access key 信息,来弥补免费用户并发和请求数量受限的

特性

  • 双线程请求
  • 可传入多个用户的 access key 和 access secret
  • 可指定单个请求线程 2 次请求间的时间间隔

Api 列表

使用示例

//只使用一个用户的AccessKey 来调用
//BaiduYunApi api=new BaiduYunApi(PrivateCode.client_id_1, PrivateCode.client_secret_1);

//使用多个用户的AccseeKey 来调用
ArrayList<AccessKey> accessKeys=new ArrayList<>();
accessKeys.add(new AccessKey(PrivateCode.client_id_1, PrivateCode.client_secret_1));
accessKeys.add(new AccessKey(PrivateCode.client_id_2, PrivateCode.client_secret_2));

BaiduYunApi api=new BaiduYunApi(accessKeys);

//词语的词向量接口测试
ArrayList<String> wordVecTestList =new ArrayList<>();

wordVecTestList.add("关羽");
wordVecTestList.add("张飞");
wordVecTestList.add("刘备");

//传入需要进行词向量计算的词语列表,以及多个单个线程 2 次请求间的时间间隔
ArrayList<WordVector> resList=api.getWordEmbVecList(wordVecTestList,100L);

System.out.println("==========Vec结果============");
System.out.println();
int i = 0;
for (WordVector wordVector:resList){
    System.out.println((i++) +":" + wordVector.getWord() +"\t"+ wordVector.showVec());
}
System.out.println();
System.out.println("============结果=============");

更多使用例子请参考 BaiduApiTest.java 代码

项目依赖

  • okhttp 3.8.1

    • okio 1.13.0
  • fastjson 1.2.32

baidubec_api's People

Contributors

ericwyn avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.