You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

nlp.rst 2.9 kB

5 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. API - Natural Language Processing
  2. ==================================
  3. Natural Language Processing and Word Representation.
  4. .. automodule:: tensorlayer.nlp
  5. .. autosummary::
  6. generate_skip_gram_batch
  7. sample
  8. sample_top
  9. SimpleVocabulary
  10. Vocabulary
  11. process_sentence
  12. create_vocab
  13. simple_read_words
  14. read_words
  15. read_analogies_file
  16. build_vocab
  17. build_reverse_dictionary
  18. build_words_dataset
  19. save_vocab
  20. words_to_word_ids
  21. word_ids_to_words
  22. basic_tokenizer
  23. create_vocabulary
  24. initialize_vocabulary
  25. sentence_to_token_ids
  26. data_to_token_ids
  27. moses_multi_bleu
  28. Iteration function for training embedding matrix
  29. -------------------------------------------------
  30. .. autofunction:: generate_skip_gram_batch
  31. Sampling functions
  32. -------------------
  33. Simple sampling
  34. ^^^^^^^^^^^^^^^^^^^
  35. .. autofunction:: sample
  36. Sampling from top k
  37. ^^^^^^^^^^^^^^^^^^^^^^
  38. .. autofunction:: sample_top
  39. Vector representations of words
  40. -------------------------------
  41. Simple vocabulary class
  42. ^^^^^^^^^^^^^^^^^^^^^^^^^
  43. .. autoclass:: SimpleVocabulary
  44. Vocabulary class
  45. ^^^^^^^^^^^^^^^^^^^^^^^^^
  46. .. autoclass:: Vocabulary
  47. Process sentence
  48. ^^^^^^^^^^^^^^^^^^^^^^^^
  49. .. autofunction:: process_sentence
  50. Create vocabulary
  51. ^^^^^^^^^^^^^^^^^^^^^^^^
  52. .. autofunction:: create_vocab
  53. Read words from file
  54. ----------------------
  55. Simple read file
  56. ^^^^^^^^^^^^^^^^^^
  57. .. autofunction:: simple_read_words
  58. Read file
  59. ^^^^^^^^^^^^^^^^^^
  60. .. autofunction:: read_words
  61. Read analogy question file
  62. -----------------------------
  63. .. autofunction:: read_analogies_file
  64. Build vocabulary, word dictionary and word tokenization
  65. --------------------------------------------------------
  66. Build dictionary from word to id
  67. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  68. .. autofunction:: build_vocab
  69. Build dictionary from id to word
  70. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  71. .. autofunction:: build_reverse_dictionary
  72. Build dictionaries for id to word etc
  73. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  74. .. autofunction:: build_words_dataset
  75. Save vocabulary
  76. ^^^^^^^^^^^^^^^^^^^^
  77. .. autofunction:: save_vocab
  78. Convert words to IDs and IDs to words
  79. --------------------------------------------------------
  80. These functions can be done by ``Vocabulary`` class.
  81. List of Words to IDs
  82. ^^^^^^^^^^^^^^^^^^^^^^^
  83. .. autofunction:: words_to_word_ids
  84. List of IDs to Words
  85. ^^^^^^^^^^^^^^^^^^^^^
  86. .. autofunction:: word_ids_to_words
  87. Functions for translation
  88. ---------------------------
  89. Word Tokenization
  90. ^^^^^^^^^^^^^^^^^^^
  91. .. autofunction:: basic_tokenizer
  92. Create or read vocabulary
  93. ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  94. .. autofunction:: create_vocabulary
  95. .. autofunction:: initialize_vocabulary
  96. Convert words to IDs and IDs to words
  97. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  98. .. autofunction:: sentence_to_token_ids
  99. .. autofunction:: data_to_token_ids
  100. Metrics
  101. ---------------------------
  102. BLEU
  103. ^^^^^^^^^^^^^^^^^^^
  104. .. autofunction:: moses_multi_bleu

TensorLayer3.0 是一款兼容多种深度学习框架为计算后端的深度学习库。计划兼容TensorFlow, Pytorch, MindSpore, Paddle.