Contact Us
Back top
Current Location : APIs > 关键词提取
关键词提取 Transactions( 111 )

关键词提取

Intro. : keyword extraction

Tag : 文本挖掘 On Shelves Time : 2017-10-11

Type :

Tutorials

Total invocations(updated per hour)

关键词提取 0.50 yuan/100calls

API Mark

Example

Error Code
-- 请求示例 url curl -i "http://api01.idataapi.cn:8000/nlp/text2kw/idataapi?apikey={Your apikey}"
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.Reader; import java.net.URL; import java.nio.charset.Charset; import org.json.JSONException; import org.json.JSONObject; import java.io.PrintWriter; import java.net.URLConnection; public class Example { private static String readAll(Reader rd) throws IOException { StringBuilder sb = new StringBuilder(); int cp; while ((cp = rd.read()) != -1) { sb.append((char) cp); } return sb.toString(); } public static JSONObject postRequestFromUrl(String url, String body) throws IOException, JSONException { URL realUrl = new URL(url); URLConnection conn = realUrl.openConnection(); conn.setDoOutput(true); conn.setDoInput(true); PrintWriter out = new PrintWriter(conn.getOutputStream()); out.print(body); out.flush(); InputStream instream = conn.getInputStream(); try { BufferedReader rd = new BufferedReader(new InputStreamReader(instream, Charset.forName("UTF-8"))); String jsonText = readAll(rd); JSONObject json = new JSONObject(jsonText); return json; } finally { instream.close(); } } public static JSONObject getRequestFromUrl(String url) throws IOException, JSONException { URL realUrl = new URL(url); URLConnection conn = realUrl.openConnection(); InputStream instream = conn.getInputStream(); try { BufferedReader rd = new BufferedReader(new InputStreamReader(instream, Charset.forName("UTF-8"))); String jsonText = readAll(rd); JSONObject json = new JSONObject(jsonText); return json; } finally { instream.close(); } } public static void main(String[] args) throws IOException, JSONException { // 请求示例 url String url = "http://api01.idataapi.cn:8000/nlp/text2kw/idataapi?apikey={Your apikey}"; String body = ""; JSONObject json = postRequestFromUrl(url,body); System.out.println(json.toString()); } }
//using System.Net.Security; //using System.Security.Cryptography.X509Certificates; private const String method = "POST"; static void Main(string[] args) { String bodys = ""; // 请求示例 url String url = "http://api01.idataapi.cn:8000/nlp/text2kw/idataapi?apikey={Your apikey}"; HttpWebRequest httpRequest = null; HttpWebResponse httpResponse = null; if (url.Contains("https://")) { ServicePointManager.ServerCertificateValidationCallback = new RemoteCertificateValidationCallback(CheckValidationResult); httpRequest = (HttpWebRequest)WebRequest.CreateDefault(new Uri(url)); } else { httpRequest = (HttpWebRequest)WebRequest.Create(url); } httpRequest.Method = method; if (0 < bodys.Length) { byte[] data = Encoding.UTF8.GetBytes(bodys); using (Stream stream = httpRequest.GetRequestStream()) { stream.Write(data, 0, data.Length); } } try { httpResponse = (HttpWebResponse)httpRequest.GetResponse(); } catch (WebException ex) { httpResponse = (HttpWebResponse)ex.Response; } Console.WriteLine(httpResponse.StatusCode); Console.WriteLine(httpResponse.Method); Console.WriteLine(httpResponse.Headers); Stream st = httpResponse.GetResponseStream(); StreamReader reader = new StreamReader(st, Encoding.GetEncoding("utf-8")); Console.WriteLine(reader.ReadToEnd()); Console.WriteLine("\n"); } public static bool CheckValidationResult(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors errors) { return true; }
<?php $method = "POST"; // 请求示例 url $url = "http://api01.idataapi.cn:8000/nlp/text2kw/idataapi?apikey={Your apikey}"; $curl = curl_init(); curl_setopt($curl, CURLOPT_CUSTOMREQUEST, $method); curl_setopt($curl, CURLOPT_URL, $url); curl_setopt($curl, CURLOPT_FAILONERROR, false); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); curl_setopt($curl, CURLOPT_POSTFIELDS, $post_data); curl_setopt($curl, CURLOPT_HEADER, true); curl_setopt($curl, CURLOPT_ENCODING, "gzip"); var_dump(curl_exec($curl)); ?>
# coding:utf-8 """ Compatible for python2.x and python3.x requirement: pip install requests six """ from __future__ import print_function import requests from six.moves.urllib.parse import urlencode from six.moves import input # 请求示例 url url = "http://api01.idataapi.cn:8000/nlp/text2kw/idataapi?apikey={Your apikey}" headers = { "Accept-Encoding": "gzip", "Connection": "close" } # body 参数填这里 post_param = { } if __name__ == "__main__": r = requests.post(url, data=urlencode(post_param), headers=headers) json_obj = r.json() print(json_obj)

Request Field( Params marked* means users should choose one from the each marked items to fill in.)

Property Name Type Mandatory Example Description
text string 根据电子商务价值理论,电子商务企业进行产品创新能有效提升或创造客户价值,但电子商务市场环境因素可能会影响电子商务企业的产品创新,而已有关于产品创新的研究大多聚焦于传统市场。依据电子商务客户价值、从众行为、多重创新、组织学习和信息过载等理论,以电子商务市场的两个主要特征市场信息和竞争强度为前导变量,构建它们对于电子商务企业产品创新倾向和电子商务企业绩效的影响模型,并提出变量间关系假设。通过收集中国最大B2C平台天猫商城内309家电子商务企业的数据,应用多元回归分析方法实证检验电子商务市场特征对产品创新的影响。研究结果表明,电子商务企业产品创新正向影响企业绩效;市场信息促进电子商务企业产品创新,但其效用受竞争强度的反向调节;竞争强度显著加强电子商务企业的产品创新倾向且不会影响企业创新绩效,因为在当前电子商务发展阶段和电子商务市场特性的作用下,产品创新能获得熊彼得租金,主导产品创新的是竞争脱离效应而非熊彼得效应。本研究结论对电子商务企业实践具有一定的指导意义。
similarity string
window number
phrases number
del_word_if_phrases number
topN number
threshold number
industry string

Response Fields

Property Name Type Example Description
  • dataType string nlp.text2kw api类型
  • appCode string bitspaceman 应用代码
  • version string v0.0.3 版本号
  • retcode string 000000 返回状态码
  • -
    RankDist array [...] 返回的前N关键字
    • word string 电子商务 关键字
    • weight number 0.04909105602693057 对应权重

Returns The Sample

{
    "dataType": "nlp.text2kw",
    "appCode": "bitspaceman",
    "version": "v0.0.3",
    "retcode": "000000",
    "RankDist": [
        {
            "word": "电子商务",
            "weight": 0.049091056026931
        },
        {
            "word": "市场",
            "weight": 0.039893465033964
        },
        {
            "word": "影响",
            "weight": 0.035509864871041
        },
        {
            "word": "企业",
            "weight": 0.034615729815999
        },
        {
            "word": "大多",
            "weight": 0.027233742013457
        },
        {
            "word": "变量",
            "weight": 0.027233742013457
        },
        {
            "word": "天猫",
            "weight": 0.024221000261849
        },
        {
            "word": "平台",
            "weight": 0.024221000261849
        },
        {
            "word": "创新",
            "weight": 0.023595242268985
        },
        {
            "word": "价值",
            "weight": 0.023407948724004
        }
    ]
}

Detailed Data

No Details

状态码

Status Code Return Value Format : JSON

{

message:"API rate limit exceeded",

retcode:100703

}

The API in our platform is only paid when invoked successfully. For the detail, please refer to the below table.

Status Code Code Meaning Detailed Description Need paid or not?
000000 invoke successfully(data is not null) 成功调用并返回数据
100002 Search no result 目标参数搜索没结果
100000 Server internal error 服务器内部错误
100001 Network error 网络错误
100004 Target server error 目标服务器错误
100005 Param error 用户输入参数错误
100301 Account not found 用户帐号不存在
100700 Invalid authentication credentials 授权失败
100701 API stopped 您的当前API已停用
100702 Account stopped 您的账户已停用
100703 API rate limit exceeded 并发已达上限
100704 API maintenance API维护中
100705 API not found with these values API不存在
100706 Please add api first 请先添加api
100707 Number of calls exceeded 调用次数超限
100802 Missing url param 'time' or uri path is not equal to 2 请求路径错误或者缺少"time"参数
100803 Wrong pageToken 参数pageToken有误

Often With The Purchase Of Data