জাভা স্ট্যানফোর্ড এনএলপি: স্পিচ লেবেলের অংশ?


172

স্ট্যানফোর্ড এনএলপি, এখানে ডেমোড করে এইভাবে একটি আউটপুট দেয়:

Colorless/JJ green/JJ ideas/NNS sleep/VBP furiously/RB ./.

স্পিচ ট্যাগের অংশ বলতে কী বোঝায়? আমি কোনও অফিসিয়াল তালিকা খুঁজে পাচ্ছি না। এটি স্ট্যানফোর্ডের নিজস্ব সিস্টেম, না তারা সর্বজনীন ট্যাগ ব্যবহার করছে? ( JJউদাহরণস্বরূপ কী ?)

এছাড়াও, যখন আমি বাক্যগুলির মাধ্যমে পুনরাবৃত্তি করি, বিশেষ্যগুলি সন্ধান করি, উদাহরণস্বরূপ, আমি ট্যাগটি পরীক্ষা করে দেখার জন্য কিছু করা শেষ করি .contains('N')। এটি বেশ দুর্বল বোধ করে। বক্তৃতাটির একটি নির্দিষ্ট অংশের জন্য প্রোগ্রামমেটিকভাবে অনুসন্ধান করার আরও ভাল উপায় কি নেই?


এটি একটি নিটপিক হতে পারে, তবে আপনার .starts_with('N')পরিবর্তে ব্যবহার করা উচিত contains, যেহেতু 'IN' এবং 'VBN' এ 'এন' রয়েছে। এবং এটি সম্ভবত ট্যাগার কোন শব্দটিকে বিশেষ্য বলে মনে করে এটি সন্ধান করার সর্বোত্তম উপায়।
জোসেফ

উত্তর:


276

পেন ট্রিব্যাঙ্ক প্রকল্প । এ লুক পার্ট অফ স্পিচ ট্যাগিং গীত।

জেজে বিশেষণ is এনএনএস হ'ল বিশেষ্য, বহুবচন। ভিবিপি ক্রিয়াপদ বর্তমান কাল হয়। আরবি বিশেষণ

এটা ইংরেজির জন্য। চিনাদের জন্য, এটি পেন চাইনিজ ট্রিব্যাঙ্ক। এবং জার্মানদের জন্য এটি নাইগ্রা কর্পাস।

  1. সিসি সমন্বয় সমন্বয়
  2. সিডি কার্ডিনাল নম্বর
  3. ডিটি নির্ধারণকারী
  4. সেখানে এক্স উপস্থিতি
  5. এফডাব্লু বিদেশী শব্দ
  6. ইন প্রস্তুতি বা অধস্তন সংমিশ্রণ
  7. জেজে বিশেষণ
  8. জেজেআর বিশেষণ, তুলনামূলক
  9. জেজেএস বিশেষণ, চূড়ান্ত
  10. এলএস তালিকা আইটেম চিহ্নিতকারী
  11. এমডি মোডাল
  12. এনএন বিশেষ্য, একক বা ভর
  13. এনএনএস বিশেষ্য, বহুবচন
  14. এনএনপি যথাযথ নাম, একক
  15. এনএনপিএস যথাযথ বিশেষ্য, বহুবচন
  16. পিডিটি পূর্বনির্ধারক
  17. পোস প্যাসিসিভ সমাপ্ত
  18. PRP ব্যক্তিগত সর্বনাম
  19. PRP $ প্যাসেসিভ সর্বনাম
  20. আরবি অ্যাডভারব
  21. আরবিআর বিশেষণ, তুলনামূলক
  22. আরবিএস অ্যাডওয়ারব, চূড়ান্ত
  23. আরপি কণা
  24. এসওয়াইএম প্রতীক
  25. টু
  26. ইউএইচ বাধা
  27. ভিবি ভার্ব, বেস ফর্ম
  28. ভিবিডি ক্রিয়া, অতীত কাল
  29. ভিবিজি ভার্ব, গ্রুন্ড বা উপস্থিত অংশগ্রহণকারী
  30. ভিবিএন ভার্ব, পূর্বের অংশগ্রহণকারী
  31. ভিবিপি ভার্ব, নন 3 তম ব্যক্তি একক উপস্থিত
  32. ভিবিজেড ভার্ব, তৃতীয় ব্যক্তি একক উপস্থিত
  33. ডাব্লুডিটি হুইডটারমিনিয়ার
  34. ডব্লিউপি হুইপ্রোনন
  35. ডব্লিউপি $ প্যাসেসিভ হুইপ্রোনউন
  36. ডাব্লুআরবি ভ্যাডভারব

এই উত্তরের একটি ঘাটতি সমাধান করার জন্য আমার সম্পাদনার প্রস্তাব প্রত্যাখ্যান করা হয়েছিল। অতএব, দয়া করে নীচে আমার পোস্ট করা উত্তরটিও দেখুন যা এই উত্তর থেকে অনুপস্থিত কিছু তথ্য রয়েছে।
জুলাই

3
দশম এলএস ঠিক কী?
দেবব্রত

3
"থেকে" অবশ্যই বিশেষ হতে হবে। নিজস্ব ট্যাগ পেয়েছিলাম
quemeful

4
এর সত্যই দুর্দান্ত রেফারেন্স হ'ল এরউইন আর কোমেনের তালিকা এবং স্পিচ ট্যাগ অফ পার্টস অফ স্পিচ ট্যাগস । আগ্রহের বিষয়টিও হতে পারে ইংলিশ এবং কোমেনের হোমপৃষ্ঠায় কোমেনের গবেষণা , erwinkomen.ruhosting.nl
কুলহ্যান্ডলুইস

1
স্ট্যানফোর্ড পিওএস ট্যাগার এবং পেন ট্রি ব্যাংকে ব্যবহৃত ট্যাগগুলি কি একই?
gokul_uf

113
Explanation of each tag from the documentation :

CC: conjunction, coordinating
    & 'n and both but either et for less minus neither nor or plus so
    therefore times v. versus vs. whether yet
CD: numeral, cardinal
    mid-1890 nine-thirty forty-two one-tenth ten million 0.5 one forty-
    seven 1987 twenty '79 zero two 78-degrees eighty-four IX '60s .025
    fifteen 271,124 dozen quintillion DM2,000 ...
DT: determiner
    all an another any both del each either every half la many much nary
    neither no some such that the them these this those
EX: existential there
    there
FW: foreign word
    gemeinschaft hund ich jeux habeas Haementeria Herr K'ang-si vous
    lutihaw alai je jour objets salutaris fille quibusdam pas trop Monte
    terram fiche oui corporis ...
IN: preposition or conjunction, subordinating
    astride among uppon whether out inside pro despite on by throughout
    below within for towards near behind atop around if like until below
    next into if beside ...
JJ: adjective or numeral, ordinal
    third ill-mannered pre-war regrettable oiled calamitous first separable
    ectoplasmic battery-powered participatory fourth still-to-be-named
    multilingual multi-disciplinary ...
JJR: adjective, comparative
    bleaker braver breezier briefer brighter brisker broader bumper busier
    calmer cheaper choosier cleaner clearer closer colder commoner costlier
    cozier creamier crunchier cuter ...
JJS: adjective, superlative
    calmest cheapest choicest classiest cleanest clearest closest commonest
    corniest costliest crassest creepiest crudest cutest darkest deadliest
    dearest deepest densest dinkiest ...
LS: list item marker
    A A. B B. C C. D E F First G H I J K One SP-44001 SP-44002 SP-44005
    SP-44007 Second Third Three Two * a b c d first five four one six three
    two
MD: modal auxiliary
    can cannot could couldn't dare may might must need ought shall should
    shouldn't will would
NN: noun, common, singular or mass
    common-carrier cabbage knuckle-duster Casino afghan shed thermostat
    investment slide humour falloff slick wind hyena override subhumanity
    machinist ...
NNS: noun, common, plural
    undergraduates scotches bric-a-brac products bodyguards facets coasts
    divestitures storehouses designs clubs fragrances averages
    subjectivists apprehensions muses factory-jobs ...
NNP: noun, proper, singular
    Motown Venneboerger Czestochwa Ranzer Conchita Trumplane Christos
    Oceanside Escobar Kreisler Sawyer Cougar Yvette Ervin ODI Darryl CTCA
    Shannon A.K.C. Meltex Liverpool ...
NNPS: noun, proper, plural
    Americans Americas Amharas Amityvilles Amusements Anarcho-Syndicalists
    Andalusians Andes Andruses Angels Animals Anthony Antilles Antiques
    Apache Apaches Apocrypha ...
PDT: pre-determiner
    all both half many quite such sure this
POS: genitive marker
    ' 's
PRP: pronoun, personal
    hers herself him himself hisself it itself me myself one oneself ours
    ourselves ownself self she thee theirs them themselves they thou thy us
PRP$: pronoun, possessive
    her his mine my our ours their thy your
RB: adverb
    occasionally unabatingly maddeningly adventurously professedly
    stirringly prominently technologically magisterially predominately
    swiftly fiscally pitilessly ...
RBR: adverb, comparative
    further gloomier grander graver greater grimmer harder harsher
    healthier heavier higher however larger later leaner lengthier less-
    perfectly lesser lonelier longer louder lower more ...
RBS: adverb, superlative
    best biggest bluntest earliest farthest first furthest hardest
    heartiest highest largest least less most nearest second tightest worst
RP: particle
    aboard about across along apart around aside at away back before behind
    by crop down ever fast for forth from go high i.e. in into just later
    low more off on open out over per pie raising start teeth that through
    under unto up up-pp upon whole with you
SYM: symbol
    % & ' '' ''. ) ). * + ,. < = > @ A[fj] U.S U.S.S.R * ** ***
TO: "to" as preposition or infinitive marker
    to
UH: interjection
    Goodbye Goody Gosh Wow Jeepers Jee-sus Hubba Hey Kee-reist Oops amen
    huh howdy uh dammit whammo shucks heck anyways whodunnit honey golly
    man baby diddle hush sonuvabitch ...
VB: verb, base form
    ask assemble assess assign assume atone attention avoid bake balkanize
    bank begin behold believe bend benefit bevel beware bless boil bomb
    boost brace break bring broil brush build ...
VBD: verb, past tense
    dipped pleaded swiped regummed soaked tidied convened halted registered
    cushioned exacted snubbed strode aimed adopted belied figgered
    speculated wore appreciated contemplated ...
VBG: verb, present participle or gerund
    telegraphing stirring focusing angering judging stalling lactating
    hankerin' alleging veering capping approaching traveling besieging
    encrypting interrupting erasing wincing ...
VBN: verb, past participle
    multihulled dilapidated aerosolized chaired languished panelized used
    experimented flourished imitated reunifed factored condensed sheared
    unsettled primed dubbed desired ...
VBP: verb, present tense, not 3rd person singular
    predominate wrap resort sue twist spill cure lengthen brush terminate
    appear tend stray glisten obtain comprise detest tease attract
    emphasize mold postpone sever return wag ...
VBZ: verb, present tense, 3rd person singular
    bases reconstructs marks mixes displeases seals carps weaves snatches
    slumps stretches authorizes smolders pictures emerges stockpiles
    seduces fizzes uses bolsters slaps speaks pleads ...
WDT: WH-determiner
    that what whatever which whichever
WP: WH-pronoun
    that what whatever whatsoever which who whom whosoever
WP$: WH-pronoun, possessive
    whose
WRB: Wh-adverb
    how however whence whenever where whereby whereever wherein whereof why

2
আপনি কি উত্স উদ্ধৃত করতে পারেন?
ডেভিড পোর্টাবেলা

বিরামচিহ্নগুলি সম্পর্কে কী? উদাহরণস্বরূপ, একটি ',' টোকেন পিওএস পায় ','। এই পিওএস অন্তর্ভুক্ত একটি তালিকা আছে?
ডেভিড পোর্টাবেলা


34

উপরে গৃহীত উত্তরটি নিম্নলিখিত তথ্য অনুপস্থিত:

এখানে 9 টি বিরামচিহ্ন ট্যাগও সংজ্ঞায়িত করা হয়েছে (যা কিছু রেফারেন্সে তালিকাভুক্ত নয়, এখানে দেখুন )। এইগুলো:

  1. #
  2. $
  3. '' (সমাপ্ত উদ্ধৃতিতে সমস্ত ধরণের জন্য ব্যবহৃত)
  4. ((খোলার প্রথম বন্ধনের জন্য ব্যবহৃত)
  5. ) (বন্ধের প্রথম বন্ধনের জন্য ব্যবহৃত)
  6. ,
  7. । (সমস্ত বাক্য-সমাপ্ত বিরামচিহ্নের জন্য ব্যবহৃত)
  8. : (কলোন, সেমিকোলন এবং উপবৃত্তের জন্য ব্যবহৃত)
  9. `` (উদ্বোধনের উদ্ধৃতিতে সমস্ত ধরণের জন্য ব্যবহৃত)

17

এখানে পেন ট্রিব্যাঙ্কের সম্পূর্ণ ট্যাগগুলির সম্পূর্ণ তালিকা রয়েছে ( সম্পূর্ণতার জন্য এখানে পোস্ট করা):

http://www.surdeanu.info/mihai/teaching/ista555-fall13/readings/PennTreebankConstituents.html

এটি ক্লজ এবং বাক্যাংশের স্তরের জন্য ট্যাগগুলিও অন্তর্ভুক্ত করে।

ক্লজ লেভেল

- S
- SBAR
- SBARQ
- SINV
- SQ

বাক্যাংশ স্তর

- ADJP
- ADVP
- CONJP
- FRAG
- INTJ
- LST
- NAC
- NP
- NX
- PP
- PRN
- PRT
- QP
- RRC
- UCP
- VP
- WHADJP
- WHAVP
- WHNP
- WHPP
- X

(লিঙ্কে বর্ণনা)


2
তুমি কি জান? এটিই সত্য তালিকা যা মানুষের প্রয়োজন! কেবল পেন ট্রিব্যাঙ্ক পোস ট্যাগ নয় কারণ সেগুলি কেবল শব্দের জন্য
বায়ুওয়ালা

সংক্ষিপ্তসারগুলির পরে বর্ণনাগুলি যুক্ত করতে পারেন?
পেট্রাস থেরন

12

আপনি যদি কোডটি কোডিং করতে চান তবেই ...

/**
 * Represents the English parts-of-speech, encoded using the
 * de facto <a href="http://www.cis.upenn.edu/~treebank/">Penn Treebank
 * Project</a> standard.
 * 
 * @see <a href="ftp://ftp.cis.upenn.edu/pub/treebank/doc/tagguide.ps.gz">Penn Treebank Specification</a>
 */
public enum PartOfSpeech {
  ADJECTIVE( "JJ" ),
  ADJECTIVE_COMPARATIVE( ADJECTIVE + "R" ),
  ADJECTIVE_SUPERLATIVE( ADJECTIVE + "S" ),

  /* This category includes most words that end in -ly as well as degree
   * words like quite, too and very, posthead modi ers like enough and
   * indeed (as in good enough, very well indeed), and negative markers like
   * not, n't and never.
   */
  ADVERB( "RB" ),

  /* Adverbs with the comparative ending -er but without a strictly comparative
   * meaning, like <i>later</i> in <i>We can always come by later</i>, should
   * simply be tagged as RB.
   */
  ADVERB_COMPARATIVE( ADVERB + "R" ),
  ADVERB_SUPERLATIVE( ADVERB + "S" ),

  /* This category includes how, where, why, etc.
   */
  ADVERB_WH( "W" + ADVERB ),

  /* This category includes and, but, nor, or, yet (as in Y et it's cheap,
   * cheap yet good), as well as the mathematical operators plus, minus, less,
   * times (in the sense of "multiplied by") and over (in the sense of "divided
   * by"), when they are spelled out. <i>For</i> in the sense of "because" is
   * a coordinating conjunction (CC) rather than a subordinating conjunction.
   */
  CONJUNCTION_COORDINATING( "CC" ),
  CONJUNCTION_SUBORDINATING( "IN" ),
  CARDINAL_NUMBER( "CD" ),
  DETERMINER( "DT" ),

  /* This category includes which, as well as that when it is used as a
   * relative pronoun.
   */
  DETERMINER_WH( "W" + DETERMINER ),
  EXISTENTIAL_THERE( "EX" ),
  FOREIGN_WORD( "FW" ),

  LIST_ITEM_MARKER( "LS" ),

  NOUN( "NN" ),
  NOUN_PLURAL( NOUN + "S" ),
  NOUN_PROPER_SINGULAR( NOUN + "P" ),
  NOUN_PROPER_PLURAL( NOUN + "PS" ),

  PREDETERMINER( "PDT" ),
  POSSESSIVE_ENDING( "POS" ),

  PRONOUN_PERSONAL( "PRP" ),
  PRONOUN_POSSESSIVE( "PRP$" ),

  /* This category includes the wh-word whose.
   */
  PRONOUN_POSSESSIVE_WH( "WP$" ),

  /* This category includes what, who and whom.
   */
  PRONOUN_WH( "WP" ),

  PARTICLE( "RP" ),

  /* This tag should be used for mathematical, scientific and technical symbols
   * or expressions that aren't English words. It should not used for any and
   * all technical expressions. For instance, the names of chemicals, units of
   * measurements (including abbreviations thereof) and the like should be
   * tagged as nouns.
   */
  SYMBOL( "SYM" ),
  TO( "TO" ),

  /* This category includes my (as in M y, what a gorgeous day), oh, please,
   * see (as in See, it's like this), uh, well and yes, among others.
   */
  INTERJECTION( "UH" ),

  VERB( "VB" ),
  VERB_PAST_TENSE( VERB + "D" ),
  VERB_PARTICIPLE_PRESENT( VERB + "G" ),
  VERB_PARTICIPLE_PAST( VERB + "N" ),
  VERB_SINGULAR_PRESENT_NONTHIRD_PERSON( VERB + "P" ),
  VERB_SINGULAR_PRESENT_THIRD_PERSON( VERB + "Z" ),

  /* This category includes all verbs that don't take an -s ending in the
   * third person singular present: can, could, (dare), may, might, must,
   * ought, shall, should, will, would.
   */
  VERB_MODAL( "MD" ),

  /* Stanford.
   */
  SENTENCE_TERMINATOR( "." );

  private final String tag;

  private PartOfSpeech( String tag ) {
    this.tag = tag;
  }

  /**
   * Returns the encoding for this part-of-speech.
   * 
   * @return A string representing a Penn Treebank encoding for an English
   * part-of-speech.
   */
  public String toString() {
    return getTag();
  }

  protected String getTag() {
    return this.tag;
  }

  public static PartOfSpeech get( String value ) {
    for( PartOfSpeech v : values() ) {
      if( value.equals( v.getTag() ) ) {
        return v;
      }
    }

    throw new IllegalArgumentException( "Unknown part of speech: '" + value + "'." );
  }
}

7

আমি এখানে পুরো তালিকা সরবরাহ করছি এবং রেফারেন্স লিঙ্কটিও দিচ্ছি

1.  CC   Coordinating conjunction
2.  CD   Cardinal number
3.  DT   Determiner
4.  EX   Existential there
5.  FW   Foreign word
6.  IN   Preposition or subordinating conjunction
7.  JJ   Adjective
8.  JJR  Adjective, comparative
9.  JJS  Adjective, superlative
10. LS   List item marker
11. MD   Modal
12. NN   Noun, singular or mass
13. NNS  Noun, plural
14. NNP  Proper noun, singular
15. NNPS Proper noun, plural
16. PDT  Predeterminer
17. POS  Possessive ending
18. PRP  Personal pronoun
19. PRP$ Possessive pronoun
20. RB   Adverb
21. RBR  Adverb, comparative
22. RBS  Adverb, superlative
23. RP   Particle
24. SYM  Symbol
25. TO   to
26. UH   Interjection
27. VB   Verb, base form
28. VBD  Verb, past tense
29. VBG  Verb, gerund or present participle
30. VBN  Verb, past participle
31. VBP  Verb, non-3rd person singular present
32. VBZ  Verb, 3rd person singular present
33. WDT  Wh-determiner
34. WP   Wh-pronoun
35. WP$  Possessive wh-pronoun
36. WRB  Wh-adverb

আপনি স্পিচ ট্যাগের যন্ত্রাংশের পুরো তালিকাটি এখানে খুঁজে পেতে পারেন ।


4

আপনার নির্দিষ্ট পোস (যেমন, বিশেষ্য) ট্যাগযুক্ত শব্দ / অংশ খুঁজে পাওয়ার দ্বিতীয় প্রশ্ন সম্পর্কিত, আপনি অনুসরণ করতে পারেন এমন নমুনা কোডটি এখানে।

public static void main(String[] args) {
    Properties properties = new Properties();
    properties.put("annotators", "tokenize, ssplit, pos, lemma, ner, parse");
    StanfordCoreNLP pipeline = new StanfordCoreNLP(properties);

    String input = "Colorless green ideas sleep furiously.";
    Annotation annotation = pipeline.process(input);
    List<CoreMap> sentences = annotation.get(CoreAnnotations.SentencesAnnotation.class);
    List<String> output = new ArrayList<>();
    String regex = "([{pos:/NN|NNS|NNP/}])"; //Noun
    for (CoreMap sentence : sentences) {
        List<CoreLabel> tokens = sentence.get(CoreAnnotations.TokensAnnotation.class);
        TokenSequencePattern pattern = TokenSequencePattern.compile(regex);
        TokenSequenceMatcher matcher = pattern.getMatcher(tokens);
        while (matcher.find()) {
            output.add(matcher.group());
        }
    }
    System.out.println("Input: "+input);
    System.out.println("Output: "+output);
}

আউটপুটটি হ'ল:

Input: Colorless green ideas sleep furiously.
Output: [ideas]

2

তারা ব্রাউন করপাস ট্যাগ বলে মনে হচ্ছে ।


14
না, এগুলি হ'ল পেন ইংলিশ ট্রিব্যাঙ্ক পস ট্যাগ, যা ব্রাউন করপাস ট্যাগ সেটটির সরলিকরণ।
ক্রিস্টোফার ম্যানিং

তুমি কি নিশ্চিত? উপরে উদ্ধৃত উদাহরণটিতে "এর ট্যাগ অন্তর্ভুক্ত রয়েছে।" যা ব্রাউন করপাসে সংজ্ঞায়িত, তবে উপরের পেন ট্রিব্যাঙ্ক ট্যাগগুলির তালিকা দ্বারা সংজ্ঞায়িত হয়নি, সুতরাং এটি মোটামুটি নিশ্চিত বলে মনে হচ্ছে যে উত্তরটি কেবল পেন ট্রিব্যাঙ্ক ট্যাগের মতোই খুব সহজ নয়।
জুলাই

রয়ে অতিরিক্ত গবেষণা এটা মনে হয় যে তারা সম্পন্ন হলে, হয় পেন Treebank ট্যাগও 9 বিরামচিহ্ন ট্যাগ যে গৃহীত উত্তরে তালিকা থেকে বাদ দেওয়া হয়েছে অন্তর্ভুক্ত: পেন Treebank ট্যাগ, কিন্তু ডকুমেন্টেশন যেমন ট্যাগ উপরের উদ্ধৃত অসম্পূর্ণ হয়। আরও তথ্যের জন্য আমার অতিরিক্ত উত্তর দেখুন।
জুলাই

2

অন্যান্য ভাষার জন্য স্ট্যানফোর্ড কোরএনএলপি ট্যাগ: ফরাসি, স্পেনীয়, জার্মান ...

আমি দেখতে পাচ্ছি যে আপনি ইংরেজি ভাষার জন্য পার্সার ব্যবহার করেন, এটি ডিফল্ট মডেল। আপনি অন্য ভাষার জন্য পার্সার ব্যবহার করতে পারেন (ফরাসী, স্পেনীয়, জার্মান ...) এবং সচেতন থাকুন, প্রতিটি ভাষার জন্য টোকেনাইজার এবং স্পিচ ট্যাগারের অংশ পৃথক। যদি আপনি এটি করতে চান তবে আপনাকে অবশ্যই ভাষার জন্য নির্দিষ্ট মডেলটি ডাউনলোড করতে হবে (উদাহরণস্বরূপ মাভেনের মতো একজন নির্মাতাকে ব্যবহার করে) এবং তারপরে আপনি যে মডেলটি ব্যবহার করতে চান সেটি সেট করতে হবে। এখানে আপনার সম্পর্কে আরও তথ্য রয়েছে।

এখানে আপনি বিভিন্ন ভাষার জন্য ট্যাগগুলির তালিকা:

  1. স্প্যানিশদের জন্য স্ট্যানফোর্ড কোরএনএলপি পোস ট্যাগস
  2. জার্মান জন্য স্ট্যানফোর্ড CoreNLP পিওএস ট্যাগার ব্যবহার স্টুটগার্ট-টুবিঙ্গেন ট্যাগ সেট (STTS)
  3. ফরাসিদের জন্য স্ট্যানফোর্ড কোরএনএলপি পোস ট্যাগার নিম্নলিখিত ট্যাগগুলি ব্যবহার করে:

মুক্তির জন্য ট্যাগস:

ফরাসিদের জন্য স্পিচ ট্যাগগুলির অংশ

A     (adjective)
Adv   (adverb)
CC    (coordinating conjunction)
Cl    (weak clitic pronoun)
CS    (subordinating conjunction)
D     (determiner)
ET    (foreign word)
I     (interjection)
NC    (common noun)
NP    (proper noun)
P     (preposition)
PREF  (prefix)
PRO   (strong pronoun)
V     (verb)
PONCT (punctuation mark)

ফ্রেঞ্চ জন্য ফ্রেসাল বিভাগ ট্যাগ:

AP     (adjectival phrases)
AdP    (adverbial phrases)
COORD  (coordinated phrases)
NP     (noun phrases)
PP     (prepositional phrases)
VN     (verbal nucleus)
VPinf  (infinitive clauses)
VPpart (nonfinite clauses)
SENT   (sentences)
Sint, Srel, Ssub (finite clauses)

ফরাসিদের জন্য সিনট্যাকটিক ফাংশন:

SUJ    (subject)
OBJ    (direct object)
ATS    (predicative complement of a subject)
ATO    (predicative complement of a direct object)
MOD    (modifier or adjunct)
A-OBJ  (indirect complement introduced by à)
DE-OBJ (indirect complement introduced by de)
P-OBJ  (indirect complement introduced by another preposition)

@ আইম্যারোস্টেগুই: ইঙ্গিতটির জন্য আপনাকে ধন্যবাদ। দয়া করে একটি লিঙ্ক ভাগ করুন যেখানে স্পষ্টভাবে উল্লেখ করা হয়েছে যে সার্বজনীন নির্ভরতা স্পেনীয়দের জন্য ব্যবহৃত হয়। লিঙ্কটি ইউডির জন্য তবে এগুলির কোনও ইঙ্গিত নেই যে এগুলি আসলে স্ট্যানফোর্ড কোর এনএলপিতে স্পেনীয়দের জন্য ব্যবহৃত হয়েছিল এবং স্ট্যানফোর্ডের সরকারী দস্তাবেজগুলির মধ্যে এটিরও উল্লেখ নেই।
ক্যাটালিনা চিরচু

0

স্পেসে এটি খুব দ্রুত ছিল বলে আমি মনে করি, কেবলমাত্র একটি নিম্ন-প্রান্তের নোটবুকটি এটি এভাবে চলবে:

import spacy
import time

start = time.time()

with open('d:/dictionary/e-store.txt') as f:
    input = f.read()

word = 0
result = []

nlp = spacy.load("en_core_web_sm")
doc = nlp(input)

for token in doc:
    if token.pos_ == "NOUN":
        result.append(token.text)
    word += 1

elapsed = time.time() - start

print("From", word, "words, there is", len(result), "NOUN found in", elapsed, "seconds")

বেশ কয়েকটি পরীক্ষায় আউটপুট:

From 3547 words, there is 913 NOUN found in 7.768507719039917 seconds
From 3547 words, there is 913 NOUN found in 7.408619403839111 seconds
From 3547 words, there is 913 NOUN found in 7.431427955627441 seconds

সুতরাং, আমি মনে করি প্রতিটি পোস ট্যাগ চেকের জন্য আপনাকে লুপিংয়ের বিষয়ে চিন্তা করার দরকার নেই :)

নির্দিষ্ট পাইপলাইন অক্ষম করলে আরও উন্নতি পেয়েছি:

nlp = spacy.load("en_core_web_sm", disable = 'ner')

সুতরাং, ফলাফলটি দ্রুত:

From 3547 words, there is 913 NOUN found in 6.212834596633911 seconds
From 3547 words, there is 913 NOUN found in 6.257707595825195 seconds
From 3547 words, there is 913 NOUN found in 6.371225833892822 seconds
আমাদের সাইট ব্যবহার করে, আপনি স্বীকার করেছেন যে আপনি আমাদের কুকি নীতি এবং গোপনীয়তা নীতিটি পড়েছেন এবং বুঝতে পেরেছেন ।
Licensed under cc by-sa 3.0 with attribution required.