Skip to content

Commit

Permalink
AUTO docusaurus 20231002
Browse files Browse the repository at this point in the history
  • Loading branch information
GitHub CI committed Oct 2, 2023
1 parent 40f9655 commit 9d5ccc2
Show file tree
Hide file tree
Showing 103 changed files with 271 additions and 289 deletions.
2 changes: 1 addition & 1 deletion .github/scripts/download_pretrained.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def get_model_name_and_weights_from_config(
if model_name not in model_class_dict:
raise KeyError(
f"'{model_name}' not a valid model name. Choose from "
f"{str(list(model_class_dict.keys()))} or create"
f"{list(model_class_dict.keys())!s} or create"
f"a new class inheriting from this class to support your model."
)

Expand Down
20 changes: 15 additions & 5 deletions .github/tests/test_download_pretrained.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ def test_download_pretrained_lmf_exists_with_model_name():
config = yaml.load(CONFIG_FPATH)

steps = config.get("pipeline", [])
step = list(filter(lambda x: x["name"] == download_pretrained.COMP_NAME, steps))[0]
step = list( # noqa: RUF015
filter(lambda x: x["name"] == download_pretrained.COMP_NAME, steps)
)[0]
step["model_name"] = "roberta"
step["cache_dir"] = "/this/dir"

Expand All @@ -41,7 +43,9 @@ def test_download_pretrained_unknown_model_name():
config = yaml.load(CONFIG_FPATH)

steps = config.get("pipeline", [])
step = list(filter(lambda x: x["name"] == download_pretrained.COMP_NAME, steps))[0]
step = list( # noqa: RUF015
filter(lambda x: x["name"] == download_pretrained.COMP_NAME, steps)
)[0]
step["model_name"] = "unknown"

with tempfile.NamedTemporaryFile("w+") as fp:
Expand All @@ -56,7 +60,9 @@ def test_download_pretrained_multiple_model_names():
config = yaml.load(CONFIG_FPATH)

steps = config.get("pipeline", [])
step = list(filter(lambda x: x["name"] == download_pretrained.COMP_NAME, steps))[0]
step = list( # noqa: RUF015
filter(lambda x: x["name"] == download_pretrained.COMP_NAME, steps)
)[0]
step_new = deepcopy(step)
step_new["model_name"] = "roberta"
steps.append(step_new)
Expand All @@ -74,7 +80,9 @@ def test_download_pretrained_with_model_name_and_nondefault_weight():
config = yaml.load(CONFIG_FPATH)

steps = config.get("pipeline", [])
step = list(filter(lambda x: x["name"] == download_pretrained.COMP_NAME, steps))[0]
step = list( # noqa: RUF015
filter(lambda x: x["name"] == download_pretrained.COMP_NAME, steps)
)[0]
step["model_name"] = "bert"
step["model_weights"] = "bert-base-uncased"

Expand All @@ -91,7 +99,9 @@ def test_download_pretrained_lmf_doesnt_exists():
config = yaml.load(CONFIG_FPATH)

steps = config.get("pipeline", [])
step = list(filter(lambda x: x["name"] == download_pretrained.COMP_NAME, steps))[0]
step = list( # noqa: RUF015
filter(lambda x: x["name"] == download_pretrained.COMP_NAME, steps)
)[0]
steps.remove(step)

with tempfile.NamedTemporaryFile("w+") as fp:
Expand Down
4 changes: 2 additions & 2 deletions docs/docs/reference/rasa/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ title: rasa.api
```python
def run(model: "Text",
endpoints: "Text",
connector: "Text" = None,
credentials: "Text" = None,
connector: "Optional[Text]" = None,
credentials: "Optional[Text]" = None,
**kwargs: "Dict[Text, Any]") -> None
```

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/reference/rasa/core/channels/channel.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Includes the channel the responses should be sent to.
def __init__(text: Optional[Text] = None,
output_channel: Optional["OutputChannel"] = None,
sender_id: Optional[Text] = None,
parse_data: Dict[Text, Any] = None,
parse_data: Optional[Dict[Text, Any]] = None,
input_channel: Optional[Text] = None,
message_id: Optional[Text] = None,
metadata: Optional[Dict] = None,
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/reference/rasa/core/channels/rocketchat.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ async def send_text_message(recipient_id: Text, text: Text,
**kwargs: Any) -> None
```

Send message to output channel
Send message to output channel.

## RocketChatInput Objects

Expand Down
4 changes: 2 additions & 2 deletions docs/docs/reference/rasa/core/channels/socketio.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ async def send_image_url(recipient_id: Text, image: Text,
**kwargs: Any) -> None
```

Sends an image to the output
Sends an image to the output.

#### send\_text\_with\_buttons

Expand Down Expand Up @@ -87,7 +87,7 @@ async def send_custom_json(recipient_id: Text, json_message: Dict[Text, Any],
**kwargs: Any) -> None
```

Sends custom json to the output
Sends custom json to the output.

#### send\_attachment

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/reference/rasa/core/channels/telegram.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ Sends a message with a custom json payload.
class TelegramInput(InputChannel)
```

Telegram input channel
Telegram input channel.

#### get\_output\_channel

Expand Down
2 changes: 2 additions & 0 deletions docs/docs/reference/rasa/core/evaluation/marker_base.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ Instantiates a marker.
applies if and only if the non-negated marker does not apply)
- `description` - an optional description of the marker. It is not used
internally but can be used to document the marker.


**Raises**:

Expand Down Expand Up @@ -352,6 +353,7 @@ Instantiates a marker.
conversion of this marker
- `description` - an optional description of the marker. It is not used
internally but can be used to document the marker.


**Raises**:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Represents a wrapper over a `TrackerStore` with a configurable access pattern.
```python
def __init__(tracker_store: TrackerStore,
strategy: str,
count: int = None,
count: Optional[int] = None,
seed: Any = None) -> None
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ Fingerprint the container.
#### messages

```python
def messages(key_attribute: Text = None) -> ValuesView
def messages(key_attribute: Optional[Text] = None) -> ValuesView
```

Returns a view of all messages.
Expand Down
4 changes: 2 additions & 2 deletions docs/docs/reference/rasa/core/tracker_store.md
Original file line number Diff line number Diff line change
Expand Up @@ -653,8 +653,8 @@ def get_db_url(dialect: Text = "sqlite",
host: Optional[Text] = None,
port: Optional[int] = None,
db: Text = "rasa.db",
username: Text = None,
password: Text = None,
username: Optional[Text] = None,
password: Optional[Text] = None,
login_db: Optional[Text] = None,
query: Optional[Dict] = None) -> Union[Text, "URL"]
```
Expand Down
9 changes: 5 additions & 4 deletions docs/docs/reference/rasa/core/training/interactive.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,10 +160,11 @@ Add routes to serve the conversation visualization files.
#### run\_interactive\_learning

```python
def run_interactive_learning(file_importer: TrainingDataImporter,
skip_visualization: bool = False,
conversation_id: Text = uuid.uuid4().hex,
server_args: Dict[Text, Any] = None) -> None
def run_interactive_learning(
file_importer: TrainingDataImporter,
skip_visualization: bool = False,
conversation_id: Text = uuid.uuid4().hex,
server_args: Optional[Dict[Text, Any]] = None) -> None
```

Start the interactive learning with the model of the agent.
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/reference/rasa/nlu/extractors/extractor.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def convert_predictions_into_entities(
text: Text,
tokens: List[Token],
tags: Dict[Text, List[Text]],
split_entities_config: Dict[Text, bool] = None,
split_entities_config: Optional[Dict[Text, bool]] = None,
confidences: Optional[Dict[Text, List[float]]] = None
) -> List[Dict[Text, Any]]
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ def xlm_embeddings_post_processor(
sequence_embeddings: np.ndarray) -> Tuple[np.ndarray, np.ndarray]
```

Post process embeddings from XLM models
Post process embeddings from XLM models.

by taking a mean over sequence embeddings and returning that as sentence
representation. Remove first and last time steps
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/reference/rasa/shared/core/conversation.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ title: rasa.shared.core.conversation
class Dialogue()
```

A dialogue comprises a list of Turn objects
A dialogue comprises a list of Turn objects.

#### \_\_init\_\_

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/reference/rasa/shared/core/trackers.md
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@ Dump the tracker as a story to a file.
def get_last_event_for(
event_type: Union[Type["EventTypeAlias"], Tuple[Type["EventTypeAlias"],
...]],
action_names_to_exclude: List[Text] = None,
action_names_to_exclude: Optional[List[Text]] = None,
skip: int = 0,
event_verbosity: EventVerbosity = EventVerbosity.APPLIED
) -> Optional["EventTypeAlias"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ Turns Story steps into an string.
the existing story file.
- `is_test_story` - Identifies if the stories should be exported in test stories
format.


**Returns**:

Expand Down
4 changes: 2 additions & 2 deletions docs/docs/reference/rasa/shared/nlu/training_data/message.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ Retrieve message property.
def as_dict_nlu() -> dict
```

Get dict representation of message as it would appear in training data
Get dict representation of message as it would appear in training data.

#### as\_dict

Expand Down Expand Up @@ -146,7 +146,7 @@ Builds a Message from `UserUttered` data.
def get_full_intent() -> Text
```

Get intent as it appears in training data
Get intent as it appears in training data.

#### separate\_intent\_response\_key

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ Calculates the number of examples per entity.
def sort_regex_features() -> None
```

Sorts regex features lexicographically by name+pattern
Sorts regex features lexicographically by name+pattern.

#### nlu\_as\_json

Expand Down
3 changes: 2 additions & 1 deletion docs/docs/reference/rasa/shared/nlu/training_data/util.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def transform_entity_synonyms(
known_synonyms: Optional[Dict[Text, Any]] = None) -> Dict[Text, Any]
```

Transforms the entity synonyms into a text->value dictionary
Transforms the entity synonyms into a text->value dictionary.

#### get\_file\_format\_extension

Expand All @@ -29,6 +29,7 @@ same known format, return it's extension
**Arguments**:

- `resource_name` - The name of the resource, can be a file or a folder.


**Returns**:

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/reference/rasa/utils/endpoints.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ def read_endpoint_config(filename: Text,
endpoint_type: Text) -> Optional["EndpointConfig"]
```

Read an endpoint configuration file from disk and extract one
Read an endpoint configuration file from disk and extract one.

config.

Expand Down
5 changes: 5 additions & 0 deletions docs/docs/reference/rasa/utils/tensorflow/crf.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ Computes the unary scores of tag sequences.
- `tag_indices` - A [batch_size, max_seq_len] matrix of tag indices.
- `sequence_lengths` - A [batch_size] vector of true sequence lengths.
- `inputs` - A [batch_size, max_seq_len, num_tags] tensor of unary potentials.


**Returns**:

Expand All @@ -168,6 +169,7 @@ Computes the binary scores of tag sequences.
- `tag_indices` - A [batch_size, max_seq_len] matrix of tag indices.
- `sequence_lengths` - A [batch_size] vector of true sequence lengths.
- `transition_params` - A [num_tags, num_tags] matrix of binary potentials.


**Returns**:

Expand All @@ -191,6 +193,7 @@ Computes the unnormalized score for a tag sequence.
we compute the unnormalized score.
- `sequence_lengths` - A [batch_size] vector of true sequence lengths.
- `transition_params` - A [num_tags, num_tags] transition matrix.


**Returns**:

Expand Down Expand Up @@ -239,6 +242,7 @@ Computes the normalization for a CRF.
to use as input to the CRF layer.
- `sequence_lengths` - A [batch_size] vector of true sequence lengths.
- `transition_params` - A [num_tags, num_tags] transition matrix.


**Returns**:

Expand Down Expand Up @@ -266,6 +270,7 @@ Computes the log-likelihood of tag sequences in a CRF.
- `sequence_lengths` - A [batch_size] vector of true sequence lengths.
- `transition_params` - A [num_tags, num_tags] transition matrix,
if available.


**Returns**:

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/reference/rasa/utils/tensorflow/layers.md
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ def f1_score(tag_ids: tf.Tensor, pred_ids: tf.Tensor,
mask: tf.Tensor) -> tf.Tensor
```

Calculates f1 score for train predictions
Calculates f1 score for train predictions.

## DotProductLoss Objects

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/sources/rasa_interactive___help.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ options:
--conversation-id CONVERSATION_ID
Specify the id of the conversation the messages are
in. Defaults to a UUID that will be randomly
generated. (default: d8274dd1c0b743279c3d5754cf8d4701)
generated. (default: c7b0c8957e9b4ade97e3a6bf4d87a4dd)
--endpoints ENDPOINTS
Configuration file for the model server and the
connectors as a yml file. (default: endpoints.yml)
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/sources/rasa_shell___help.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ options:
-h, --help show this help message and exit
--conversation-id CONVERSATION_ID
Set the conversation ID. (default:
368875d2e6844d0d9e7cd66da0fb02fb)
d2436920ecba4b0e80992625be3a2fd8)
-m MODEL, --model MODEL
Path to a trained Rasa model. If a directory is
specified, it will use the latest model in this
Expand Down

0 comments on commit 9d5ccc2

Please sign in to comment.