Skip to content

Commit

Permalink
Merge pull request #151 from ShangziXue/dev
Browse files Browse the repository at this point in the history
[DOC] Update tutorial docs and api docs
  • Loading branch information
nnnyt authored Aug 5, 2023
2 parents 5f2f71f + 00e3726 commit 3e6204c
Show file tree
Hide file tree
Showing 6 changed files with 1,418 additions and 3 deletions.
36 changes: 36 additions & 0 deletions docs/source/api/ModelZoo.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,56 @@ base_model
.. automodule:: EduNLP.ModelZoo.base_model
:members:

::
相关方法中的参数说明:

save_pretrained(output_dir):
output_dir: str
The path you want to save your model

classmethodfrom_pretrained(pretrained_model_path, *args, **kwargs):
pretrained_model_path: str
The path where you load your checkpoint from

save_config(config_dir):
config_dir: str
The path you want to save the config file
@classmethod
from_config(config_path, *args, **kwargs):
config_path: str
The path where you load the config file


rnn
-----------

.. automodule:: EduNLP.ModelZoo.rnn
:members:
:imported-members:

::
参数补充说明:
@classmethod from_config(config_path, **kwargs):
config_path: str
The path where you load the config file



disenqnet
-----------

.. automodule:: EduNLP.ModelZoo.disenqnet
:members:
:imported-members:

::
参数补充说明:
@classmethod from_config(config_path, **kwargs):
config_path: str
The path where you load the config file

quesnet
-----------

Expand Down
82 changes: 82 additions & 0 deletions docs/source/api/tokenizer.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,85 @@ EduNLP.Tokenizer
.. automodule:: EduNLP.Tokenizer
:members:
:imported-members:

AstFormulaTokenizer参数定义
#######################################

::
Parameters
----------
symbol : str, optional
Elements to symbolize before tokenization, by default "gmas"
figures : _type_, optional
Info for figures in items, by default None
"""
CharTokenizer参数定义
#######################################

::
"""Tokenize text char by char. eg. "题目内容" -> ["题", "目", "内", 容"]

Parameters
----------
stop_words : str, optional
stop_words to skip, by default "default"
"""

CustomTokenizer参数定义
#######################################

::
"""Tokenize SIF items by customized configuration

Parameters
----------
symbol : str, optional
Elements to symbolize before tokenization, by default "gmas"
figures : _type_, optional
Info for figures in items, by default None
kwargs: addtional configuration for SIF items
including text_params, formula_params, figure_params, more details could be found in `EduNLP.SIF.sif4sci`
"""

PureTextTokenizer参数定义
#######################################

::
"""
Treat all elements in SIF item as prue text. Spectially, tokenize formulas as text.

Parameters
----------
handle_figure_formula : str, optional
whether to skip or symbolize special formulas( $\\FormFigureID{…}$ and $\\FormFigureBase64{…}),
by default skip

SpaceTokenizer参数定义
#######################################

::
"""
Tokenize text by space. eg. "题目 内容" -> ["题目", "内容"]

Parameters
----------
stop_words : str, optional
stop_words to skip, by default "default"
"""

EduNLP.Tokenizer.get_tokenizer参数定义
#######################################

::
Parameters
----------
name: str
the name of tokenizer, e.g. text, pure_text.
args:
the parameters passed to tokenizer
kwargs:
the parameters passed to tokenizer
Returns
-------
tokenizer: Tokenizer
Loading

0 comments on commit 3e6204c

Please sign in to comment.