{"id":1155235,"date":"2025-01-13T18:00:50","date_gmt":"2025-01-13T10:00:50","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/1155235.html"},"modified":"2025-01-13T18:00:56","modified_gmt":"2025-01-13T10:00:56","slug":"python%e5%a6%82%e4%bd%95%e5%ae%89%e8%a3%85%e4%be%9d%e5%ad%98%e5%8f%a5%e6%b3%95","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/1155235.html","title":{"rendered":"python\u5982\u4f55\u5b89\u88c5\u4f9d\u5b58\u53e5\u6cd5"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/25184635\/065b4c3c-8d37-440b-b5eb-26bbed4f9021.webp\" alt=\"python\u5982\u4f55\u5b89\u88c5\u4f9d\u5b58\u53e5\u6cd5\" \/><\/p>\n<p><p> \u8981\u5b89\u88c5Python\u4f9d\u5b58\u53e5\u6cd5\u89e3\u6790\u5668\uff0c\u53ef\u4ee5\u4f7f\u7528\u4e00\u4e9b\u5e38\u89c1\u7684\u4f9d\u5b58\u53e5\u6cd5\u89e3\u6790\u5e93\uff0c\u4f8b\u5982\uff1a<strong>spaCy\u3001Stanza\u3001SyntaxNet<\/strong>\u3002\u6bcf\u4e2a\u5e93\u90fd\u6709\u5176\u72ec\u7279\u7684\u529f\u80fd\u548c\u5b89\u88c5\u65b9\u6cd5\uff0c\u4e0b\u9762\u6211\u5c06\u8be6\u7ec6\u4ecb\u7ecd\u5982\u4f55\u5b89\u88c5\u548c\u4f7f\u7528\u8fd9\u4e9b\u5e93\u4e2d\u7684\u4e00\u79cd\u2014\u2014spaCy\u3002<\/p>\n<\/p>\n<p><p><strong>spaCy<\/strong>\u662f\u4e00\u4e2a\u5f00\u6e90\u7684\u81ea\u7136\u8bed\u8a00\u5904\u7406\u5e93\uff0c\u63d0\u4f9b\u4e86\u5feb\u901f\u4e14\u51c6\u786e\u7684\u4f9d\u5b58\u53e5\u6cd5\u5206\u6790\u529f\u80fd\u3002\u5b83\u652f\u6301\u591a\u79cd\u8bed\u8a00\uff0c\u5e76\u4e14\u5177\u6709\u6613\u4e8e\u4f7f\u7528\u7684API\u63a5\u53e3\u3002\u8981\u5b89\u88c5spaCy\u5e76\u4f7f\u7528\u5176\u4f9d\u5b58\u53e5\u6cd5\u89e3\u6790\u529f\u80fd\uff0c\u60a8\u53ef\u4ee5\u6309\u7167\u4ee5\u4e0b\u6b65\u9aa4\u64cd\u4f5c\uff1a<\/p>\n<\/p>\n<ol>\n<li>\u5b89\u88c5spaCy\u5e93\uff1a<\/li>\n<\/ol>\n<p><pre><code class=\"language-bash\">pip install spacy<\/p>\n<p><\/code><\/pre>\n<\/p>\n<ol start=\"2\">\n<li>\u4e0b\u8f7d\u5e76\u5b89\u88c5spaCy\u7684\u8bed\u8a00\u6a21\u578b\uff08\u4ee5\u82f1\u8bed\u6a21\u578b\u4e3a\u4f8b\uff09\uff1a<\/li>\n<\/ol>\n<p><pre><code class=\"language-bash\">python -m spacy download en_core_web_sm<\/p>\n<p><\/code><\/pre>\n<\/p>\n<ol start=\"3\">\n<li>\u4f7f\u7528spaCy\u8fdb\u884c\u4f9d\u5b58\u53e5\u6cd5\u5206\u6790\uff1a<\/li>\n<\/ol>\n<p><pre><code class=\"language-python\">import spacy<\/p>\n<h2><strong>\u52a0\u8f7d\u82f1\u8bed\u6a21\u578b<\/strong><\/h2>\n<p>nlp = spacy.load(&quot;en_core_web_sm&quot;)<\/p>\n<h2><strong>\u521b\u5efa\u4e00\u4e2a\u6587\u6863\u5bf9\u8c61<\/strong><\/h2>\n<p>doc = nlp(&quot;This is a sample sentence for dependency parsing.&quot;)<\/p>\n<h2><strong>\u8f93\u51fa\u4f9d\u5b58\u53e5\u6cd5\u5206\u6790\u7ed3\u679c<\/strong><\/h2>\n<p>for token in doc:<\/p>\n<p>    print(f&quot;Token: {token.text}, Head: {token.head.text}, Dependency: {token.dep_}&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u4e00\u3001spaCy\u4f9d\u5b58\u53e5\u6cd5\u89e3\u6790<\/h3>\n<\/p>\n<p><p>spaCy\u662f\u4e00\u4e2a\u6d41\u884c\u7684\u81ea\u7136\u8bed\u8a00\u5904\u7406\u5e93\uff0c\u5e7f\u6cdb\u5e94\u7528\u4e8e\u6587\u672c\u5206\u6790\u4e0e\u5904\u7406\u4efb\u52a1\u3002\u5b83\u7684\u4f9d\u5b58\u53e5\u6cd5\u89e3\u6790\u5668\u57fa\u4e8e\u6df1\u5ea6\u5b66\u4e60\u65b9\u6cd5\uff0c\u80fd\u591f\u9ad8\u6548\u3001\u51c6\u786e\u5730\u5bf9\u53e5\u5b50\u8fdb\u884c\u5206\u6790\u3002spaCy\u7684\u5b89\u88c5\u8fc7\u7a0b\u7b80\u5355\uff0c\u4f7f\u7528\u65b9\u4fbf\uff0c\u5e76\u4e14\u652f\u6301\u591a\u79cd\u8bed\u8a00\u3002<\/p>\n<\/p>\n<p><h4>\u5b89\u88c5spaCy<\/h4>\n<\/p>\n<p><p>\u8981\u5b89\u88c5spaCy\uff0c\u53ef\u4ee5\u4f7f\u7528pip\u5305\u7ba1\u7406\u5668\u3002\u5728\u7ec8\u7aef\u6216\u547d\u4ee4\u884c\u4e2d\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">pip install spacy<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u60a8\u8fd8\u9700\u8981\u4e0b\u8f7dspaCy\u7684\u8bed\u8a00\u6a21\u578b\u3002\u4ee5\u82f1\u8bed\u6a21\u578b\u4e3a\u4f8b\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u4e0b\u8f7d\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">python -m spacy download en_core_web_sm<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8bed\u8a00\u6a21\u578b\u7684\u5927\u5c0f\u4e0d\u540c\uff0c\u53ef\u4ee5\u6839\u636e\u9700\u8981\u9009\u62e9\u5408\u9002\u7684\u6a21\u578b\uff08\u4f8b\u5982\uff1a<code>en_core_web_md<\/code>\u3001<code>en_core_web_lg<\/code>\uff09\u3002<\/p>\n<\/p>\n<p><h4>\u4f7f\u7528spaCy\u8fdb\u884c\u4f9d\u5b58\u53e5\u6cd5\u5206\u6790<\/h4>\n<\/p>\n<p><p>\u5b89\u88c5\u5e76\u4e0b\u8f7d\u8bed\u8a00\u6a21\u578b\u540e\uff0c\u53ef\u4ee5\u4f7f\u7528spaCy\u5bf9\u6587\u672c\u8fdb\u884c\u4f9d\u5b58\u53e5\u6cd5\u5206\u6790\u3002\u4ee5\u4e0b\u662f\u4e00\u4e2a\u7b80\u5355\u7684\u793a\u4f8b\u4ee3\u7801\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import spacy<\/p>\n<h2><strong>\u52a0\u8f7d\u82f1\u8bed\u6a21\u578b<\/strong><\/h2>\n<p>nlp = spacy.load(&quot;en_core_web_sm&quot;)<\/p>\n<h2><strong>\u521b\u5efa\u4e00\u4e2a\u6587\u6863\u5bf9\u8c61<\/strong><\/h2>\n<p>doc = nlp(&quot;This is a sample sentence for dependency parsing.&quot;)<\/p>\n<h2><strong>\u8f93\u51fa\u4f9d\u5b58\u53e5\u6cd5\u5206\u6790\u7ed3\u679c<\/strong><\/h2>\n<p>for token in doc:<\/p>\n<p>    print(f&quot;Token: {token.text}, Head: {token.head.text}, Dependency: {token.dep_}&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u4e0a\u8ff0\u4ee3\u7801\u4e2d\uff0c\u6211\u4eec\u9996\u5148\u52a0\u8f7d\u4e86\u82f1\u8bed\u8bed\u8a00\u6a21\u578b\uff0c\u7136\u540e\u521b\u5efa\u4e86\u4e00\u4e2a\u5305\u542b\u5f85\u5206\u6790\u53e5\u5b50\u7684\u6587\u6863\u5bf9\u8c61\u3002\u901a\u8fc7\u904d\u5386\u6587\u6863\u5bf9\u8c61\u4e2d\u7684\u6bcf\u4e2atoken\uff0c\u53ef\u4ee5\u8f93\u51fa\u6bcf\u4e2a\u8bcd\u7684\u6587\u672c\u3001\u4f9d\u8d56\u7684\u5934\u8bcd\u53ca\u5176\u4f9d\u5b58\u5173\u7cfb\u3002<\/p>\n<\/p>\n<p><h3>\u4e8c\u3001Stanza\u4f9d\u5b58\u53e5\u6cd5\u89e3\u6790<\/h3>\n<\/p>\n<p><p>Stanza\u662f\u65af\u5766\u798f\u5927\u5b66\u5f00\u53d1\u7684\u4e00\u4e2a\u591a\u8bed\u8a00\u81ea\u7136\u8bed\u8a00\u5904\u7406\u5de5\u5177\u5305\uff0c\u652f\u6301\u4f9d\u5b58\u53e5\u6cd5\u89e3\u6790\u3001\u8bcd\u6027\u6807\u6ce8\u3001\u547d\u540d\u5b9e\u4f53\u8bc6\u522b\u7b49\u591a\u79cd\u4efb\u52a1\u3002Stanza\u57fa\u4e8ePyTorch\u5b9e\u73b0\uff0c\u5e76\u4e14\u5176\u4f9d\u5b58\u53e5\u6cd5\u89e3\u6790\u5668\u5728\u591a\u4e2a\u8bed\u8a00\u4e0a\u7684\u8868\u73b0\u975e\u5e38\u51fa\u8272\u3002<\/p>\n<\/p>\n<p><h4>\u5b89\u88c5Stanza<\/h4>\n<\/p>\n<p><p>\u8981\u5b89\u88c5Stanza\uff0c\u53ef\u4ee5\u4f7f\u7528pip\u5305\u7ba1\u7406\u5668\u3002\u5728\u7ec8\u7aef\u6216\u547d\u4ee4\u884c\u4e2d\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">pip install stanza<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u60a8\u8fd8\u9700\u8981\u4e0b\u8f7dStanza\u7684\u8bed\u8a00\u6a21\u578b\u3002\u4ee5\u82f1\u8bed\u6a21\u578b\u4e3a\u4f8b\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u4ee3\u7801\u4e0b\u8f7d\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import stanza<\/p>\n<p>stanza.download(&#39;en&#39;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>\u4f7f\u7528Stanza\u8fdb\u884c\u4f9d\u5b58\u53e5\u6cd5\u5206\u6790<\/h4>\n<\/p>\n<p><p>\u5b89\u88c5\u5e76\u4e0b\u8f7d\u8bed\u8a00\u6a21\u578b\u540e\uff0c\u53ef\u4ee5\u4f7f\u7528Stanza\u5bf9\u6587\u672c\u8fdb\u884c\u4f9d\u5b58\u53e5\u6cd5\u5206\u6790\u3002\u4ee5\u4e0b\u662f\u4e00\u4e2a\u7b80\u5355\u7684\u793a\u4f8b\u4ee3\u7801\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import stanza<\/p>\n<h2><strong>\u52a0\u8f7d\u82f1\u8bed\u6a21\u578b<\/strong><\/h2>\n<p>nlp = stanza.Pipeline(&#39;en&#39;)<\/p>\n<h2><strong>\u521b\u5efa\u4e00\u4e2a\u6587\u6863\u5bf9\u8c61<\/strong><\/h2>\n<p>doc = nlp(&quot;This is a sample sentence for dependency parsing.&quot;)<\/p>\n<h2><strong>\u8f93\u51fa\u4f9d\u5b58\u53e5\u6cd5\u5206\u6790\u7ed3\u679c<\/strong><\/h2>\n<p>for sentence in doc.sentences:<\/p>\n<p>    for word in sentence.words:<\/p>\n<p>        print(f&quot;Word: {word.text}, Head: {word.head}, Dependency: {word.deprel}&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u4e0a\u8ff0\u4ee3\u7801\u4e2d\uff0c\u6211\u4eec\u9996\u5148\u52a0\u8f7d\u4e86\u82f1\u8bed\u8bed\u8a00\u6a21\u578b\uff0c\u7136\u540e\u521b\u5efa\u4e86\u4e00\u4e2a\u5305\u542b\u5f85\u5206\u6790\u53e5\u5b50\u7684\u6587\u6863\u5bf9\u8c61\u3002\u901a\u8fc7\u904d\u5386\u6587\u6863\u5bf9\u8c61\u4e2d\u7684\u6bcf\u4e2a\u53e5\u5b50\u548c\u5355\u8bcd\uff0c\u53ef\u4ee5\u8f93\u51fa\u6bcf\u4e2a\u8bcd\u7684\u6587\u672c\u3001\u4f9d\u8d56\u7684\u5934\u8bcd\u53ca\u5176\u4f9d\u5b58\u5173\u7cfb\u3002<\/p>\n<\/p>\n<p><h3>\u4e09\u3001SyntaxNet\u4f9d\u5b58\u53e5\u6cd5\u89e3\u6790<\/h3>\n<\/p>\n<p><p>SyntaxNet\u662f\u8c37\u6b4c\u5f00\u53d1\u7684\u4e00\u4e2a\u5f00\u6e90\u81ea\u7136\u8bed\u8a00\u5904\u7406\u5de5\u5177\u5305\uff0c\u652f\u6301\u4f9d\u5b58\u53e5\u6cd5\u89e3\u6790\u3001\u8bcd\u6027\u6807\u6ce8\u7b49\u4efb\u52a1\u3002SyntaxNet\u57fa\u4e8eTensorFlow\u5b9e\u73b0\uff0c\u5176\u4f9d\u5b58\u53e5\u6cd5\u89e3\u6790\u5668\u5728\u591a\u4e2a\u8bed\u8a00\u4e0a\u7684\u8868\u73b0\u975e\u5e38\u51fa\u8272\u3002<\/p>\n<\/p>\n<p><h4>\u5b89\u88c5SyntaxNet<\/h4>\n<\/p>\n<p><p>SyntaxNet\u7684\u5b89\u88c5\u8fc7\u7a0b\u76f8\u5bf9\u590d\u6742\u4e00\u4e9b\uff0c\u9996\u5148\u9700\u8981\u5b89\u88c5TensorFlow\u3002\u53ef\u4ee5\u4f7f\u7528pip\u5305\u7ba1\u7406\u5668\u5b89\u88c5TensorFlow\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">pip install tensorflow<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u7136\u540e\uff0c\u4eceSyntaxNet\u7684GitHub\u4ed3\u5e93\u514b\u9686\u4ee3\u7801\u5e76\u8fdb\u884c\u5b89\u88c5\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">git clone https:\/\/github.com\/tensorflow\/models.git<\/p>\n<p>cd models\/research\/syntaxnet<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u63a5\u4e0b\u6765\uff0c\u6309\u7167SyntaxNet\u7684\u5b89\u88c5\u8bf4\u660e\u8fdb\u884c\u5b89\u88c5\u548c\u914d\u7f6e\u3002<\/p>\n<\/p>\n<p><h4>\u4f7f\u7528SyntaxNet\u8fdb\u884c\u4f9d\u5b58\u53e5\u6cd5\u5206\u6790<\/h4>\n<\/p>\n<p><p>\u5b89\u88c5\u5e76\u914d\u7f6eSyntaxNet\u540e\uff0c\u53ef\u4ee5\u4f7f\u7528\u5176\u4f9d\u5b58\u53e5\u6cd5\u89e3\u6790\u529f\u80fd\u3002\u4ee5\u4e0b\u662f\u4e00\u4e2a\u7b80\u5355\u7684\u793a\u4f8b\u4ee3\u7801\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import syntaxnet.load_parser_ops<\/p>\n<p>from tensorflow.python.platform import gfile<\/p>\n<h2><strong>\u52a0\u8f7d\u6a21\u578b<\/strong><\/h2>\n<p>with gfile.GFile(&#39;syntaxnet\/models\/parsey_mcparseface\/context.pbtxt&#39;, &#39;r&#39;) as f:<\/p>\n<p>    context = f.read()<\/p>\n<h2><strong>\u521b\u5efa\u4f9d\u5b58\u53e5\u6cd5\u89e3\u6790\u5668<\/strong><\/h2>\n<p>parser = syntaxnet.load_parser_ops.load_parser(<\/p>\n<p>    context=context,<\/p>\n<p>    task_context=&#39;syntaxnet\/models\/parsey_mcparseface\/context.pbtxt&#39;,<\/p>\n<p>    hidden_layer_sizes=&#39;512,512&#39;,<\/p>\n<p>    beam_size=8,<\/p>\n<p>    max_steps=1000<\/p>\n<p>)<\/p>\n<h2><strong>\u8fdb\u884c\u4f9d\u5b58\u53e5\u6cd5\u89e3\u6790<\/strong><\/h2>\n<p>sentences = [&quot;This is a sample sentence for dependency parsing.&quot;]<\/p>\n<p>for sentence in sentences:<\/p>\n<p>    print(parser.sentence_to_conll(sentence))<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u4e0a\u8ff0\u4ee3\u7801\u4e2d\uff0c\u6211\u4eec\u9996\u5148\u52a0\u8f7d\u4e86SyntaxNet\u7684\u6a21\u578b\u548c\u914d\u7f6e\u6587\u4ef6\uff0c\u7136\u540e\u521b\u5efa\u4e86\u4e00\u4e2a\u4f9d\u5b58\u53e5\u6cd5\u89e3\u6790\u5668\u3002\u901a\u8fc7\u8c03\u7528<code>sentence_to_conll<\/code>\u65b9\u6cd5\uff0c\u53ef\u4ee5\u8f93\u51fa\u4f9d\u5b58\u53e5\u6cd5\u5206\u6790\u7ed3\u679c\u3002<\/p>\n<\/p>\n<p><h3>\u56db\u3001\u4f9d\u5b58\u53e5\u6cd5\u89e3\u6790\u7684\u5e94\u7528<\/h3>\n<\/p>\n<p><p>\u4f9d\u5b58\u53e5\u6cd5\u89e3\u6790\u5728\u81ea\u7136\u8bed\u8a00\u5904\u7406\u7684\u591a\u4e2a\u5e94\u7528\u4e2d\u626e\u6f14\u7740\u91cd\u8981\u89d2\u8272\uff0c\u4f8b\u5982\uff1a<\/p>\n<\/p>\n<p><h4>\u4fe1\u606f\u62bd\u53d6<\/h4>\n<\/p>\n<p><p>\u4f9d\u5b58\u53e5\u6cd5\u89e3\u6790\u53ef\u4ee5\u5e2e\u52a9\u63d0\u53d6\u6587\u672c\u4e2d\u7684\u5173\u952e\u4fe1\u606f\u3002\u4f8b\u5982\uff0c\u4ece\u65b0\u95fb\u62a5\u9053\u4e2d\u63d0\u53d6\u4e8b\u4ef6\u3001\u4eba\u7269\u3001\u5730\u70b9\u7b49\u4fe1\u606f\uff0c\u901a\u8fc7\u5206\u6790\u53e5\u5b50\u7684\u4f9d\u5b58\u5173\u7cfb\uff0c\u53ef\u4ee5\u66f4\u51c6\u786e\u5730\u786e\u5b9a\u8fd9\u4e9b\u5143\u7d20\u4e4b\u95f4\u7684\u5173\u7cfb\u3002<\/p>\n<\/p>\n<p><h4>\u673a\u5668\u7ffb\u8bd1<\/h4>\n<\/p>\n<p><p>\u5728\u673a\u5668\u7ffb\u8bd1\u4e2d\uff0c\u4f9d\u5b58\u53e5\u6cd5\u89e3\u6790\u53ef\u4ee5\u5e2e\u52a9\u7406\u89e3\u6e90\u8bed\u8a00\u53e5\u5b50\u7684\u7ed3\u6784\uff0c\u4ece\u800c\u751f\u6210\u66f4\u7b26\u5408\u76ee\u6807\u8bed\u8a00\u8bed\u6cd5\u7684\u8bd1\u6587\u3002\u901a\u8fc7\u5206\u6790\u53e5\u5b50\u7684\u4f9d\u5b58\u5173\u7cfb\uff0c\u53ef\u4ee5\u66f4\u597d\u5730\u5904\u7406\u590d\u6742\u53e5\u5b50\u7684\u7ffb\u8bd1\u95ee\u9898\u3002<\/p>\n<\/p>\n<p><h4>\u95ee\u7b54\u7cfb\u7edf<\/h4>\n<\/p>\n<p><p>\u5728\u95ee\u7b54\u7cfb\u7edf\u4e2d\uff0c\u4f9d\u5b58\u53e5\u6cd5\u89e3\u6790\u53ef\u4ee5\u5e2e\u52a9\u7406\u89e3\u7528\u6237\u95ee\u9898\u7684\u7ed3\u6784\uff0c\u4ece\u800c\u66f4\u51c6\u786e\u5730\u63d0\u53d6\u95ee\u9898\u7684\u5173\u952e\u4fe1\u606f\u3002\u4f8b\u5982\uff0c\u901a\u8fc7\u5206\u6790\u95ee\u9898\u4e2d\u7684\u4e3b\u8c13\u5bbe\u7ed3\u6784\uff0c\u53ef\u4ee5\u66f4\u597d\u5730\u5339\u914d\u76f8\u5173\u7684\u7b54\u6848\u3002<\/p>\n<\/p>\n<p><h3>\u4e94\u3001\u4f9d\u5b58\u53e5\u6cd5\u89e3\u6790\u7684\u6311\u6218<\/h3>\n<\/p>\n<p><p>\u867d\u7136\u4f9d\u5b58\u53e5\u6cd5\u89e3\u6790\u5728\u8bb8\u591a\u5e94\u7528\u4e2d\u8868\u73b0\u51fa\u8272\uff0c\u4f46\u4ecd\u7136\u9762\u4e34\u4e00\u4e9b\u6311\u6218\uff1a<\/p>\n<\/p>\n<p><h4>\u8bed\u8a00\u591a\u6837\u6027<\/h4>\n<\/p>\n<p><p>\u4e0d\u540c\u8bed\u8a00\u7684\u53e5\u6cd5\u7ed3\u6784\u5dee\u5f02\u5f88\u5927\uff0c\u8fd9\u7ed9\u4f9d\u5b58\u53e5\u6cd5\u89e3\u6790\u5e26\u6765\u4e86\u6311\u6218\u3002\u867d\u7136\u4e00\u4e9b\u4f9d\u5b58\u53e5\u6cd5\u89e3\u6790\u5668\u652f\u6301\u591a\u79cd\u8bed\u8a00\uff0c\u4f46\u5728\u5904\u7406\u67d0\u4e9b\u8bed\u8a00\u65f6\u53ef\u80fd\u8868\u73b0\u4e0d\u4f73\u3002<\/p>\n<\/p>\n<p><h4>\u590d\u6742\u53e5\u5b50<\/h4>\n<\/p>\n<p><p>\u590d\u6742\u53e5\u5b50\u7684\u89e3\u6790\u96be\u5ea6\u8f83\u5927\uff0c\u7279\u522b\u662f\u5305\u542b\u591a\u91cd\u5d4c\u5957\u6216\u957f\u8ddd\u79bb\u4f9d\u8d56\u7684\u53e5\u5b50\u3002\u5982\u4f55\u5728\u8fd9\u4e9b\u60c5\u51b5\u4e0b\u4fdd\u6301\u9ad8\u89e3\u6790\u51c6\u786e\u5ea6\uff0c\u662f\u4f9d\u5b58\u53e5\u6cd5\u89e3\u6790\u9762\u4e34\u7684\u4e00\u4e2a\u91cd\u8981\u6311\u6218\u3002<\/p>\n<\/p>\n<p><h4>\u6570\u636e\u7a00\u758f\u6027<\/h4>\n<\/p>\n<p><p>\u4f9d\u5b58\u53e5\u6cd5\u89e3\u6790\u5668\u901a\u5e38\u9700\u8981\u5927\u91cf\u6807\u6ce8\u6570\u636e\u8fdb\u884c\u8bad\u7ec3\uff0c\u4f46\u67d0\u4e9b\u8bed\u8a00\u6216\u9886\u57df\u7684\u6807\u6ce8\u6570\u636e\u8f83\u4e3a\u7a00\u7f3a\u3002\u8fd9\u9650\u5236\u4e86\u4f9d\u5b58\u53e5\u6cd5\u89e3\u6790\u5668\u5728\u8fd9\u4e9b\u8bed\u8a00\u6216\u9886\u57df\u4e2d\u7684\u5e94\u7528\u3002<\/p>\n<\/p>\n<p><h3>\u516d\u3001\u4f9d\u5b58\u53e5\u6cd5\u89e3\u6790\u7684\u53d1\u5c55\u8d8b\u52bf<\/h3>\n<\/p>\n<p><p>\u968f\u7740\u6df1\u5ea6\u5b66\u4e60\u6280\u672f\u7684\u53d1\u5c55\uff0c\u4f9d\u5b58\u53e5\u6cd5\u89e3\u6790\u5668\u7684\u6027\u80fd\u5f97\u5230\u4e86\u663e\u8457\u63d0\u5347\u3002\u672a\u6765\uff0c\u4f9d\u5b58\u53e5\u6cd5\u89e3\u6790\u7684\u53d1\u5c55\u8d8b\u52bf\u4e3b\u8981\u4f53\u73b0\u5728\u4ee5\u4e0b\u51e0\u4e2a\u65b9\u9762\uff1a<\/p>\n<\/p>\n<p><h4>\u591a\u4efb\u52a1\u5b66\u4e60<\/h4>\n<\/p>\n<p><p>\u901a\u8fc7\u591a\u4efb\u52a1\u5b66\u4e60\u6280\u672f\uff0c\u53ef\u4ee5\u540c\u65f6\u8bad\u7ec3\u591a\u4e2a\u81ea\u7136\u8bed\u8a00\u5904\u7406\u4efb\u52a1\uff0c\u4f8b\u5982\u4f9d\u5b58\u53e5\u6cd5\u89e3\u6790\u3001\u8bcd\u6027\u6807\u6ce8\u548c\u547d\u540d\u5b9e\u4f53\u8bc6\u522b\u3002\u8fd9\u79cd\u65b9\u6cd5\u53ef\u4ee5\u63d0\u9ad8\u6a21\u578b\u7684\u6cdb\u5316\u80fd\u529b\uff0c\u51cf\u5c0f\u6570\u636e\u7a00\u758f\u6027\u5e26\u6765\u7684\u5f71\u54cd\u3002<\/p>\n<\/p>\n<p><h4>\u9884\u8bad\u7ec3\u6a21\u578b<\/h4>\n<\/p>\n<p><p>\u9884\u8bad\u7ec3\u6a21\u578b\uff08\u5982BERT\u3001GPT\u7b49\uff09\u5728\u81ea\u7136\u8bed\u8a00\u5904\u7406\u4efb\u52a1\u4e2d\u8868\u73b0\u51fa\u8272\u3002\u5c06\u9884\u8bad\u7ec3\u6a21\u578b\u5e94\u7528\u4e8e\u4f9d\u5b58\u53e5\u6cd5\u89e3\u6790\uff0c\u53ef\u4ee5\u663e\u8457\u63d0\u9ad8\u89e3\u6790\u5668\u7684\u6027\u80fd\u3002\u9884\u8bad\u7ec3\u6a21\u578b\u80fd\u591f\u6355\u6349\u4e30\u5bcc\u7684\u8bed\u8a00\u4fe1\u606f\uff0c\u4ece\u800c\u5728\u4f9d\u5b58\u53e5\u6cd5\u89e3\u6790\u4efb\u52a1\u4e2d\u53d6\u5f97\u66f4\u597d\u7684\u6548\u679c\u3002<\/p>\n<\/p>\n<p><h4>\u8de8\u8bed\u8a00\u8fc1\u79fb<\/h4>\n<\/p>\n<p><p>\u901a\u8fc7\u8de8\u8bed\u8a00\u8fc1\u79fb\u6280\u672f\uff0c\u53ef\u4ee5\u5229\u7528\u8d44\u6e90\u4e30\u5bcc\u8bed\u8a00\u7684\u6807\u6ce8\u6570\u636e\uff0c\u63d0\u5347\u8d44\u6e90\u7a00\u7f3a\u8bed\u8a00\u7684\u4f9d\u5b58\u53e5\u6cd5\u89e3\u6790\u6027\u80fd\u3002\u8fd9\u79cd\u65b9\u6cd5\u80fd\u591f\u7f13\u89e3\u6570\u636e\u7a00\u758f\u6027\u95ee\u9898\uff0c\u6269\u5c55\u4f9d\u5b58\u53e5\u6cd5\u89e3\u6790\u5668\u7684\u9002\u7528\u8303\u56f4\u3002<\/p>\n<\/p>\n<p><h4>\u5728\u7ebf\u5b66\u4e60<\/h4>\n<\/p>\n<p><p>\u5728\u7ebf\u5b66\u4e60\u6280\u672f\u53ef\u4ee5\u4f7f\u4f9d\u5b58\u53e5\u6cd5\u89e3\u6790\u5668\u5728\u5904\u7406\u65b0\u6570\u636e\u65f6\u4e0d\u65ad\u66f4\u65b0\u548c\u4f18\u5316\u6a21\u578b\u3002\u901a\u8fc7\u5728\u7ebf\u5b66\u4e60\uff0c\u89e3\u6790\u5668\u80fd\u591f\u9002\u5e94\u4e0d\u540c\u9886\u57df\u6216\u8bed\u8a00\u7684\u53d8\u5316\uff0c\u4fdd\u6301\u9ad8\u89e3\u6790\u51c6\u786e\u5ea6\u3002<\/p>\n<\/p>\n<p><h3>\u4e03\u3001\u4f9d\u5b58\u53e5\u6cd5\u89e3\u6790\u7684\u8bc4\u4ef7\u6807\u51c6<\/h3>\n<\/p>\n<p><p>\u4f9d\u5b58\u53e5\u6cd5\u89e3\u6790\u7684\u8bc4\u4ef7\u6807\u51c6\u4e3b\u8981\u5305\u62ec\u51c6\u786e\u7387\u3001\u53ec\u56de\u7387\u548cF1\u503c\u7b49\u6307\u6807\u3002\u51c6\u786e\u7387\u8868\u793a\u89e3\u6790\u5668\u6b63\u786e\u89e3\u6790\u7684\u4f9d\u5b58\u5173\u7cfb\u5360\u603b\u4f9d\u5b58\u5173\u7cfb\u7684\u6bd4\u4f8b\uff0c\u53ec\u56de\u7387\u8868\u793a\u89e3\u6790\u5668\u6b63\u786e\u89e3\u6790\u7684\u4f9d\u5b58\u5173\u7cfb\u5360\u771f\u5b9e\u4f9d\u5b58\u5173\u7cfb\u7684\u6bd4\u4f8b\uff0cF1\u503c\u662f\u51c6\u786e\u7387\u548c\u53ec\u56de\u7387\u7684\u8c03\u548c\u5e73\u5747\u6570\u3002<\/p>\n<\/p>\n<p><h4>\u51c6\u786e\u7387\uff08Accuracy\uff09<\/h4>\n<\/p>\n<p><p>\u51c6\u786e\u7387\u662f\u6307\u89e3\u6790\u5668\u6b63\u786e\u89e3\u6790\u7684\u4f9d\u5b58\u5173\u7cfb\u5360\u603b\u4f9d\u5b58\u5173\u7cfb\u7684\u6bd4\u4f8b\u3002\u8ba1\u7b97\u516c\u5f0f\u5982\u4e0b\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-math\">Accuracy = \\frac{\u6b63\u786e\u89e3\u6790\u7684\u4f9d\u5b58\u5173\u7cfb\u6570}{\u603b\u4f9d\u5b58\u5173\u7cfb\u6570}<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>\u53ec\u56de\u7387\uff08Recall\uff09<\/h4>\n<\/p>\n<p><p>\u53ec\u56de\u7387\u662f\u6307\u89e3\u6790\u5668\u6b63\u786e\u89e3\u6790\u7684\u4f9d\u5b58\u5173\u7cfb\u5360\u771f\u5b9e\u4f9d\u5b58\u5173\u7cfb\u7684\u6bd4\u4f8b\u3002\u8ba1\u7b97\u516c\u5f0f\u5982\u4e0b\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-math\">Recall = \\frac{\u6b63\u786e\u89e3\u6790\u7684\u4f9d\u5b58\u5173\u7cfb\u6570}{\u771f\u5b9e\u4f9d\u5b58\u5173\u7cfb\u6570}<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>F1\u503c\uff08F1 Score\uff09<\/h4>\n<\/p>\n<p><p>F1\u503c\u662f\u51c6\u786e\u7387\u548c\u53ec\u56de\u7387\u7684\u8c03\u548c\u5e73\u5747\u6570\uff0c\u7528\u4e8e\u7efc\u5408\u8bc4\u4ef7\u89e3\u6790\u5668\u7684\u6027\u80fd\u3002\u8ba1\u7b97\u516c\u5f0f\u5982\u4e0b\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-math\">F1 = 2 \\times \\frac{\u51c6\u786e\u7387 \\times \u53ec\u56de\u7387}{\u51c6\u786e\u7387 + \u53ec\u56de\u7387}<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u516b\u3001\u4f9d\u5b58\u53e5\u6cd5\u89e3\u6790\u7684\u5de5\u5177\u5bf9\u6bd4<\/h3>\n<\/p>\n<p><p>\u4e0d\u540c\u7684\u4f9d\u5b58\u53e5\u6cd5\u89e3\u6790\u5de5\u5177\u5728\u6027\u80fd\u3001\u6613\u7528\u6027\u548c\u9002\u7528\u6027\u65b9\u9762\u5404\u6709\u4f18\u52a3\u3002\u4e0b\u9762\u5bf9spaCy\u3001Stanza\u548cSyntaxNet\u8fd9\u4e09\u4e2a\u5e38\u89c1\u5de5\u5177\u8fdb\u884c\u5bf9\u6bd4\uff1a<\/p>\n<\/p>\n<p><h4>\u6027\u80fd\u5bf9\u6bd4<\/h4>\n<\/p>\n<p><p>\u5728\u6027\u80fd\u65b9\u9762\uff0cspaCy\u548cStanza\u57fa\u4e8e\u6df1\u5ea6\u5b66\u4e60\u65b9\u6cd5\uff0c\u80fd\u591f\u63d0\u4f9b\u8f83\u9ad8\u7684\u89e3\u6790\u51c6\u786e\u5ea6\u3002SyntaxNet\u57fa\u4e8eTensorFlow\u5b9e\u73b0\uff0c\u89e3\u6790\u6027\u80fd\u4e5f\u8f83\u4e3a\u51fa\u8272\u3002<\/p>\n<\/p>\n<p><h4>\u6613\u7528\u6027\u5bf9\u6bd4<\/h4>\n<\/p>\n<p><p>\u5728\u6613\u7528\u6027\u65b9\u9762\uff0cspaCy\u548cStanza\u7684\u5b89\u88c5\u548c\u4f7f\u7528\u76f8\u5bf9\u7b80\u5355\uff0c\u63d0\u4f9b\u4e86\u6613\u4e8e\u4f7f\u7528\u7684API\u63a5\u53e3\u3002SyntaxNet\u7684\u5b89\u88c5\u548c\u914d\u7f6e\u8f83\u4e3a\u590d\u6742\uff0c\u9700\u8981\u66f4\u591a\u7684\u914d\u7f6e\u6b65\u9aa4\u3002<\/p>\n<\/p>\n<p><h4>\u9002\u7528\u6027\u5bf9\u6bd4<\/h4>\n<\/p>\n<p><p>\u5728\u9002\u7528\u6027\u65b9\u9762\uff0cspaCy\u3001Stanza\u548cSyntaxNet\u5747\u652f\u6301\u591a\u79cd\u8bed\u8a00\uff0c\u80fd\u591f\u5904\u7406\u591a\u8bed\u8a00\u4f9d\u5b58\u53e5\u6cd5\u89e3\u6790\u4efb\u52a1\u3002Stanza\u5728\u591a\u8bed\u8a00\u652f\u6301\u65b9\u9762\u8868\u73b0\u5c24\u4e3a\u51fa\u8272\uff0c\u8986\u76d6\u4e86\u5927\u91cf\u8bed\u8a00\u3002<\/p>\n<\/p>\n<p><h3>\u4e5d\u3001\u4f9d\u5b58\u53e5\u6cd5\u89e3\u6790\u7684\u672a\u6765\u5c55\u671b<\/h3>\n<\/p>\n<p><p>\u968f\u7740\u81ea\u7136\u8bed\u8a00\u5904\u7406\u6280\u672f\u7684\u4e0d\u65ad\u53d1\u5c55\uff0c\u4f9d\u5b58\u53e5\u6cd5\u89e3\u6790\u5668\u7684\u6027\u80fd\u5c06\u8fdb\u4e00\u6b65\u63d0\u5347\u3002\u672a\u6765\uff0c\u4f9d\u5b58\u53e5\u6cd5\u89e3\u6790\u5c06\u671d\u7740\u4ee5\u4e0b\u51e0\u4e2a\u65b9\u5411\u53d1\u5c55\uff1a<\/p>\n<\/p>\n<p><h4>\u6df1\u5ea6\u96c6\u6210<\/h4>\n<\/p>\n<p><p>\u4f9d\u5b58\u53e5\u6cd5\u89e3\u6790\u5c06\u4e0e\u5176\u4ed6\u81ea\u7136\u8bed\u8a00\u5904\u7406\u4efb\u52a1\u6df1\u5ea6\u96c6\u6210\uff0c\u4f8b\u5982\u60c5\u611f\u5206\u6790\u3001\u6587\u672c\u751f\u6210\u548c\u5bf9\u8bdd\u7cfb\u7edf\u7b49\u3002\u901a\u8fc7\u96c6\u6210\u591a\u79cd\u4efb\u52a1\uff0c\u89e3\u6790\u5668\u80fd\u591f\u63d0\u4f9b\u66f4\u5168\u9762\u7684\u8bed\u8a00\u7406\u89e3\u548c\u5904\u7406\u80fd\u529b\u3002<\/p>\n<\/p>\n<p><h4>\u81ea\u9002\u5e94\u89e3\u6790<\/h4>\n<\/p>\n<p><p>\u672a\u6765\u7684\u4f9d\u5b58\u53e5\u6cd5\u89e3\u6790\u5668\u5c06\u5177\u5907\u81ea\u9002\u5e94\u80fd\u529b\uff0c\u80fd\u591f\u6839\u636e\u4e0d\u540c\u9886\u57df\u6216\u8bed\u8a00\u7684\u7279\u70b9\u8fdb\u884c\u8c03\u6574\u548c\u4f18\u5316\u3002\u8fd9\u79cd\u81ea\u9002\u5e94\u89e3\u6790\u5668\u5c06\u80fd\u591f\u66f4\u597d\u5730\u5904\u7406\u4e0d\u540c\u573a\u666f\u4e0b\u7684\u4f9d\u5b58\u53e5\u6cd5\u89e3\u6790\u4efb\u52a1\u3002<\/p>\n<\/p>\n<p><h4>\u591a\u6a21\u6001\u89e3\u6790<\/h4>\n<\/p>\n<p><p>\u591a\u6a21\u6001\u89e3\u6790\u5c06\u7ed3\u5408\u6587\u672c\u3001\u56fe\u50cf\u3001\u8bed\u97f3\u7b49\u591a\u79cd\u6a21\u6001\u4fe1\u606f\uff0c\u63d0\u4f9b\u66f4\u4e30\u5bcc\u7684\u8bed\u4e49\u7406\u89e3\u548c\u4f9d\u5b58\u5173\u7cfb\u5206\u6790\u3002\u901a\u8fc7\u7ed3\u5408\u591a\u6a21\u6001\u4fe1\u606f\uff0c\u89e3\u6790\u5668\u80fd\u591f\u66f4\u51c6\u786e\u5730\u6355\u6349\u53e5\u5b50\u4e2d\u7684\u4f9d\u5b58\u5173\u7cfb\u3002<\/p>\n<\/p>\n<p><h3>\u603b\u7ed3<\/h3>\n<\/p>\n<p><p>\u4f9d\u5b58\u53e5\u6cd5\u89e3\u6790\u5728\u81ea\u7136\u8bed\u8a00\u5904\u7406\u4e2d\u7684\u91cd\u8981\u6027\u4e0d\u8a00\u800c\u55bb\u3002\u901a\u8fc7\u5b89\u88c5\u548c\u4f7f\u7528\u5e38\u89c1\u7684\u4f9d\u5b58\u53e5\u6cd5\u89e3\u6790\u5de5\u5177\uff08\u5982spaCy\u3001Stanza\u548cSyntaxNet\uff09\uff0c\u53ef\u4ee5\u9ad8\u6548\u3001\u51c6\u786e\u5730\u8fdb\u884c\u4f9d\u5b58\u53e5\u6cd5\u5206\u6790\u3002\u5728\u5b9e\u9645\u5e94\u7528\u4e2d\uff0c\u4f9d\u5b58\u53e5\u6cd5\u89e3\u6790\u5728\u4fe1\u606f\u62bd\u53d6\u3001\u673a\u5668\u7ffb\u8bd1\u548c\u95ee\u7b54\u7cfb\u7edf\u7b49\u9886\u57df\u53d1\u6325\u7740\u91cd\u8981\u4f5c\u7528\u3002\u867d\u7136\u4f9d\u5b58\u53e5\u6cd5\u89e3\u6790\u9762\u4e34\u8bed\u8a00\u591a\u6837\u6027\u3001\u590d\u6742\u53e5\u5b50\u548c\u6570\u636e\u7a00\u758f\u6027\u7b49\u6311\u6218\uff0c\u4f46\u968f\u7740\u6280\u672f\u7684\u53d1\u5c55\uff0c\u4f9d\u5b58\u53e5\u6cd5\u89e3\u6790\u5668\u7684\u6027\u80fd\u5c06\u4e0d\u65ad\u63d0\u5347\uff0c\u5e76\u5728\u66f4\u591a\u5e94\u7528\u573a\u666f\u4e2d\u53d1\u6325\u91cd\u8981\u4f5c\u7528\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u5728Python\u4e2d\u5b89\u88c5\u4f9d\u5b58\u53e5\u6cd5\u5206\u6790\u5de5\u5177\uff1f<\/strong><br \/>\u8981\u5728Python\u4e2d\u5b89\u88c5\u4f9d\u5b58\u53e5\u6cd5\u5206\u6790\u5de5\u5177\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528\u4e00\u4e9b\u6d41\u884c\u7684\u81ea\u7136\u8bed\u8a00\u5904\u7406\u5e93\uff0c\u5982SpaCy\u6216Stanza\u3002\u9996\u5148\uff0c\u786e\u4fdd\u60a8\u7684Python\u73af\u5883\u5df2\u7ecf\u5b89\u88c5\u4e86pip\u3002\u5728\u7ec8\u7aef\u4e2d\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\u6765\u5b89\u88c5SpaCy\uff1a  <\/p>\n<pre><code class=\"language-bash\">pip install spacy\n<\/code><\/pre>\n<p>\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u60a8\u8fd8\u9700\u8981\u4e0b\u8f7d\u4e00\u4e2a\u8bed\u8a00\u6a21\u578b\uff0c\u4f8b\u5982\u82f1\u6587\u6a21\u578b\uff1a  <\/p>\n<pre><code class=\"language-bash\">python -m spacy download en_core_web_sm\n<\/code><\/pre>\n<p>\u5982\u679c\u60a8\u9009\u62e9\u4f7f\u7528Stanza\uff0c\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u547d\u4ee4\u5b89\u88c5\uff1a  <\/p>\n<pre><code class=\"language-bash\">pip install stanza\n<\/code><\/pre>\n<p>\u5b89\u88c5\u540e\uff0c\u60a8\u9700\u8981\u4e0b\u8f7d\u6240\u9700\u7684\u8bed\u8a00\u6a21\u578b\uff0c\u4f8b\u5982\uff1a  <\/p>\n<pre><code class=\"language-python\">import stanza\nstanza.download(&#39;en&#39;)\n<\/code><\/pre>\n<p>\u8fd9\u6837\uff0c\u60a8\u5c31\u53ef\u4ee5\u5728\u60a8\u7684Python\u9879\u76ee\u4e2d\u4f7f\u7528\u4f9d\u5b58\u53e5\u6cd5\u5206\u6790\u529f\u80fd\u4e86\u3002<\/p>\n<p><strong>\u54ea\u4e9b\u5e93\u9002\u5408\u8fdb\u884c\u4f9d\u5b58\u53e5\u6cd5\u5206\u6790\uff1f<\/strong><br \/>Python\u4e2d\u6709\u51e0\u4e2a\u4f18\u79c0\u7684\u5e93\u53ef\u4ee5\u8fdb\u884c\u4f9d\u5b58\u53e5\u6cd5\u5206\u6790\u3002SpaCy\u662f\u4e00\u4e2a\u9ad8\u6548\u4e14\u6613\u4e8e\u4f7f\u7528\u7684\u5e93\uff0c\u652f\u6301\u591a\u79cd\u8bed\u8a00\uff0c\u5e76\u63d0\u4f9b\u4e86\u4e30\u5bcc\u7684\u529f\u80fd\u3002\u53e6\u4e00\u4e2a\u9009\u62e9\u662fStanza\uff0c\u5b83\u662f\u65af\u5766\u798f\u5927\u5b66\u5f00\u53d1\u7684\uff0c\u4e13\u6ce8\u4e8e\u591a\u8bed\u8a00\u5904\u7406\u3002\u8fd8\u6709\u5982NLTK\u548cCoreNLP\u7b49\u5e93\u4e5f\u53ef\u4ee5\u5b9e\u73b0\u4f9d\u5b58\u53e5\u6cd5\u5206\u6790\uff0c\u4f46\u53ef\u80fd\u9700\u8981\u66f4\u591a\u7684\u914d\u7f6e\u548c\u4f9d\u8d56\u3002<\/p>\n<p><strong>\u5728\u4f7f\u7528\u4f9d\u5b58\u53e5\u6cd5\u5206\u6790\u65f6\uff0c\u5982\u4f55\u63d0\u9ad8\u5206\u6790\u7684\u51c6\u786e\u6027\uff1f<\/strong><br \/>\u63d0\u9ad8\u4f9d\u5b58\u53e5\u6cd5\u5206\u6790\u51c6\u786e\u6027\u7684\u65b9\u6cd5\u5305\u62ec\u4f7f\u7528\u9ad8\u8d28\u91cf\u7684\u9884\u8bad\u7ec3\u6a21\u578b\uff0c\u786e\u4fdd\u8f93\u5165\u7684\u6587\u672c\u8d28\u91cf\u826f\u597d\uff0c\u907f\u514d\u62fc\u5199\u9519\u8bef\u548c\u6a21\u7cca\u7684\u53e5\u5b50\u7ed3\u6784\u3002\u6b64\u5916\uff0c\u8fdb\u884c\u9002\u5f53\u7684\u6587\u672c\u9884\u5904\u7406\uff0c\u4f8b\u5982\u53bb\u9664\u4e0d\u5fc5\u8981\u7684\u6807\u70b9\u7b26\u53f7\u548c\u505c\u7528\u8bcd\uff0c\u4e5f\u6709\u52a9\u4e8e\u6539\u5584\u5206\u6790\u7ed3\u679c\u3002\u6839\u636e\u5e94\u7528\u573a\u666f\uff0c\u60a8\u8fd8\u53ef\u4ee5\u8003\u8651\u5fae\u8c03\u6a21\u578b\uff0c\u4ee5\u9002\u5e94\u7279\u5b9a\u9886\u57df\u7684\u8bed\u8a00\u7279\u5f81\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u8981\u5b89\u88c5Python\u4f9d\u5b58\u53e5\u6cd5\u89e3\u6790\u5668\uff0c\u53ef\u4ee5\u4f7f\u7528\u4e00\u4e9b\u5e38\u89c1\u7684\u4f9d\u5b58\u53e5\u6cd5\u89e3\u6790\u5e93\uff0c\u4f8b\u5982\uff1aspaCy\u3001Stanza\u3001Synta [&hellip;]","protected":false},"author":3,"featured_media":1155244,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[37],"tags":[],"acf":[],"_links":{"self":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1155235"}],"collection":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/comments?post=1155235"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1155235\/revisions"}],"predecessor-version":[{"id":1155245,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1155235\/revisions\/1155245"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/1155244"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=1155235"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=1155235"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=1155235"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}