考虑到不同的单词可能有同音异义词,有没有办法使用 NLTK 来获取单个字母字符串的一组可能的词性?
例如:report -> {Noun, Verb} , kind -> {Adjective, Noun}
我一直无法找到一个 POS-tokenizer 来标记完整句子上下文之外的词的词性。这似乎是 NLTK 的一个非常基本的要求,所以我很困惑为什么我很难找到它。
我正在为一个我认为非常简单的错误而苦苦挣扎,但我没有 Rails 的复杂性来检测该错误的位置。
我有以下表格:
<%= form_with(url: '/bills/viewer', method: :get) do |f| %>
<%= f.label :congress, 'Congress (i.e. 112)' %>
<%= f.number_field :congress, class: 'form-control' %>
<%= f.label :bill_type, 'Bill type' %>
<%= f.radio_button :bill_type, 'hr' %><%= ' House of Representatives' %>
<%= f.radio_button :bill_type, 's' %><%= ' Senate' %>
<%= f.radio_button :bill_type, 'hjres' %> <%= 'House Joint Resolution' %>
<%= f.radio_button :bill_type, 'sjres' %><%= ' Senate Joint Resolution' %>
<%= f.radio_button :bill_type, 'hconres' %><%= ' House Concurrent Resolution' %>
<%= …Run Code Online (Sandbox Code Playgroud)