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.

example.rst 3.3 kB

6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. ======
  2. 大标题
  3. ======
  4. .. note::
  5. 中文标题需要符号的数量至少是中文字数的两倍
  6. .. warning::
  7. 符号的数量只可以多,不可以少。
  8. 小标题1
  9. ###########
  10. 小标题2
  11. *********
  12. 小标题3(正常使用)
  13. ========================
  14. 小标题4
  15. -------------------
  16. 推荐使用大标题、小标题3和小标题4
  17. 官方文档 http://docutils.sourceforge.net/docs/user/rst/quickref.html
  18. `熟悉markdown的同学推荐参考这篇文章 <https://macplay.github.io/posts/cong-markdown-dao-restructuredtext/#id30>`_
  19. \<\>内表示的是链接地址,\<\>外的是显示到外面的文字
  20. 常见语法
  21. ============
  22. *emphasis*
  23. **strong**
  24. `text`
  25. ``inline literal``
  26. http://docutils.sf.net/ 孤立的网址会自动生成链接
  27. 显示为特定的文字的链接 `sohu <http://www.sohu.com>`_
  28. 突出显示的
  29. 上面文字
  30. 正常缩进
  31. 形成锻炼
  32. 特殊模块
  33. ============
  34. 选项会自动识别
  35. -v An option
  36. -o file Same with value
  37. --delta A long option
  38. --delta=len Same with value
  39. 图片
  40. .. image:: ../figures/procedures.PNG
  41. :height: 200
  42. :width: 560
  43. :scale: 50
  44. :alt: alternate text
  45. :align: center
  46. 显示一个冒号的代码块::
  47. 中间要空一行
  48. ::
  49. 不显示冒号的代码块
  50. .. code-block:: python
  51. :linenos:
  52. :emphasize-lines: 1,3
  53. print("专业的代码块")
  54. print("")
  55. print("有行号和高亮")
  56. 数学块
  57. ==========
  58. .. math::
  59. H_2O + Na = NaOH + H_2 \uparrow
  60. 复杂表格
  61. ==========
  62. +------------------------+------------+----------+----------+
  63. | Header row, column 1 | Header 2 | Header 3 | Header 4 |
  64. | (header rows optional) | | | |
  65. +========================+============+==========+==========+
  66. | body row 1, column 1 | column 2 | column 3 | column 4 |
  67. +------------------------+------------+----------+----------+
  68. | body row 2 | Cells may span columns. |
  69. +------------------------+------------+---------------------+
  70. | body row 3 | Cells may | - Table cells |
  71. +------------------------+ span rows. | - contain |
  72. | body row 4 | | - body elements. |
  73. +------------------------+------------+---------------------+
  74. 简易表格
  75. ==========
  76. ===== ===== ======
  77. Inputs Output
  78. ------------ ------
  79. A B A or B
  80. ===== ===== ======
  81. False False False
  82. True True True
  83. ===== ===== ======
  84. csv 表格
  85. ============
  86. .. csv-table::
  87. :header: sentence, target
  88. This is the first instance ., 0
  89. Second instance ., 1
  90. Third instance ., 1
  91. ..., ...
  92. [重要]各种链接
  93. ===================
  94. 各种链接帮助我们连接到fastNLP文档的各个位置
  95. \<\>内表示的是链接地址,\<\>外的是显示到外面的文字
  96. :doc:`根据文件名链接 </user/quickstart>`
  97. :mod:`~fastNLP.core.batch`
  98. :class:`~fastNLP.Batch`
  99. ~表示只显示最后一项
  100. :meth:`fastNLP.DataSet.apply`
  101. 下面这个代码是不可行的,必须要用 r""" 才行:
  102. .. code::
  103. :param float beta: f_beta分数, :math:`f_{beta} = \frac{(1 + {beta}^{2})*(pre*rec)}{({beta}^{2}*pre + rec)}` . 常用为 `beta=0.5, 1, 2` 若为0.5则精确率的权重高于召回率;若为1,则两者平等;若为2,则召回率权重高于精确率。