from typing import Sequence
from typing import Tuple
from typing import List


def pad_string_sequences(seq: Sequence[Sequence[str]]) -> Tuple[List[List[str]], Sequence[int]]:
    """ Like keras.preprocessing.sequence.pad_string_sequences but for strings, and it also returns seq_length. """

    seq_length = [len(item) for item in seq]
    maxlen = max(seq_length)

    result = []
    for i, item in enumerate(seq):
        result.append(list(item) + [''] * (maxlen - seq_length[i]))
    return result, seq_length