(name: str, force: bool = True)
Set a collection of custom extensions on the global :class:`spacy.tokens.Doc` ,
    specified by ``name`` .

    Args:
        name: Name of a function registered in :obj:`doc_extensions_registry`
            that returns a collection of custom doc extensions as a dictionary.
            For example, "extract" or "extract.keyterms".
        force: If True, set extensions even if existing extensions already exist;
            otherwise, don't overwrite existing extensions.
Set a collection of custom extensions on the global :class:`spacy.tokens.Doc` ,
    specified by ``name`` .
Set a collection of custom extensions on the global : class : spacy . tokens . Doc specified by name .
def set_doc_extensions(name: str, force: bool = True):
    """
    Set a collection of custom extensions on the global :class:`spacy.tokens.Doc` ,
    specified by ``name`` .

    Args:
        name: Name of a function registered in :obj:`doc_extensions_registry`
            that returns a collection of custom doc extensions as a dictionary.
            For example, "extract" or "extract.keyterms".
        force: If True, set extensions even if existing extensions already exist;
            otherwise, don't overwrite existing extensions.
    """
    for name, kwargs in get_doc_extensions(name).items():
        if not Doc.has_extension(name):
            Doc.set_extension(name, **kwargs)
        elif force is True:
            LOGGER.warning("%s `Doc` extension already exists; overwriting...", name)
            Doc.set_extension(name, **kwargs, force=True)
        else:
            LOGGER.warning(
                "%s `Doc` extension already exists, and was not overwritten", name
            )
def set_doc_extensions ( name : str , force : bool = True ) : for name , kwargs in get_doc_extensions ( name ) . items ( ) : if not Doc . has_extension ( name ) : Doc . set_extension ( name , * * kwargs ) elif force is True : LOGGER . warning ( "%s `Doc` extension already exists; overwriting..." , name ) Doc . set_extension ( name , * * kwargs , force = True ) else : LOGGER . warning ( "%s `Doc` extension already exists, and was not overwritten" , name )