:py:mod:`src.wic.deepmistake`
=============================

.. py:module:: src.wic.deepmistake


Module Contents
---------------

Classes
~~~~~~~

.. autoapisummary::

   src.wic.deepmistake.Model
   src.wic.deepmistake.Cache
   src.wic.deepmistake.Score
   src.wic.deepmistake.Input
   src.wic.deepmistake.DeepMistake



Functions
~~~~~~~~~

.. autoapisummary::

   src.wic.deepmistake.use_pair_group
   src.wic.deepmistake.to_data_format



Attributes
~~~~~~~~~~

.. autoapisummary::

   src.wic.deepmistake.log


.. py:data:: log

   

.. py:class:: Model


   Bases: :py:obj:`pydantic.BaseModel`

   .. py:attribute:: name
      :type: str

      

   .. py:attribute:: url
      :type: pydantic.HttpUrl

      


.. py:class:: Cache(**data: Any)


   Bases: :py:obj:`pydantic.BaseModel`

   .. py:property:: path
      :type: pathlib.Path


   .. py:attribute:: metadata
      :type: dict[str, Any]

      

   .. py:attribute:: _similarities
      :type: pandas.DataFrame

      

   .. py:attribute:: _similarities_filtered
      :type: pandas.DataFrame

      

   .. py:attribute:: __metadata__
      :type: pandas.DataFrame

      

   .. py:method:: retrieve(use_pairs: list[tuple[src.use.Use, src.use.Use]]) -> dict[tuple[src.use.UseID, src.use.UseID], float]


   .. py:method:: persist() -> None


   .. py:method:: add_use_pair(use_pair: tuple[src.use.Use, src.use.Use], similarity: float) -> None



.. py:class:: Score


   Bases: :py:obj:`TypedDict`

   .. py:attribute:: id
      :type: str

      

   .. py:attribute:: score
      :type: tuple[str, str] | str

      


.. py:function:: use_pair_group(use_pair: tuple[src.use.Use, src.use.Use]) -> str


.. py:class:: Input


   Bases: :py:obj:`TypedDict`

   .. py:attribute:: id
      :type: str

      

   .. py:attribute:: start1
      :type: int

      

   .. py:attribute:: end1
      :type: int

      

   .. py:attribute:: sentence1
      :type: str

      

   .. py:attribute:: start2
      :type: int

      

   .. py:attribute:: end2
      :type: int

      

   .. py:attribute:: sentence2
      :type: str

      

   .. py:attribute:: lemma
      :type: str

      

   .. py:attribute:: pos
      :type: str

      

   .. py:attribute:: grp
      :type: str

      


.. py:function:: to_data_format(use_pair: tuple[src.use.Use, src.use.Use]) -> Input


.. py:class:: DeepMistake


   Bases: :py:obj:`src.wic.model.WICModel`

   .. py:property:: path
      :type: pathlib.Path


   .. py:property:: repo_dir
      :type: pathlib.Path


   .. py:property:: ckpt_dir
      :type: pathlib.Path


   .. py:attribute:: ckpt
      :type: Model

      

   .. py:attribute:: cache
      :type: Cache | None

      

   .. py:method:: __enter__() -> None


   .. py:method:: __exit__(exc_type, exc_val, exc_tb)


   .. py:method:: as_df() -> pandas.DataFrame


   .. py:method:: clone_repo() -> None


   .. py:method:: __unzip_ckpt(zipped: pathlib.Path) -> None


   .. py:method:: __download_ckpt() -> pathlib.Path


   .. py:method:: predict(use_pairs: list[tuple[src.use.Use, src.use.Use]]) -> list[float]



