original_docstring: 
      Embed a single sequence from the tokenizer and prottrans model.
      
docstring: Embed a single sequence from the tokenizer and prottrans model.
docstring_tokens: Embed a single sequence from the tokenizer and prottrans model .
code: def embed_seq(sequence, tokenizer, prottrans_model, device="cpu"):
      """
      Embed a single sequence from the tokenizer and prottrans model.
      """
      sequences = [sequence]
      sep_sequences = []
      for seq in sequences:
          sep_sequences.append(" ".join([x for x in seq]))
      #print(sep_sequences)
  
      clean = [re.sub(r"[UZOB]", "X", sequence) for sequence in sep_sequences]
      #print(clean)
  
      ids = tokenizer.batch_encode_plus(clean, add_special_tokens=True, pad_to_max_length=True)
      input_ids = torch.tensor(ids['input_ids']).to(device)
      attention_mask = torch.tensor(ids['attention_mask']).to(device)
      with torch.no_grad():
          embedding = prottrans_model(input_ids=input_ids,attention_mask=attention_mask)[0]
          print(embedding.shape)
  
      return embedding
code_tokens: def embed_seq ( sequence , tokenizer , prottrans_model , device = "cpu" ) : sequences = [ sequence ] sep_sequences = [ ] for seq in sequences : sep_sequences . append ( " " . join ( [ x for x in seq ] ) ) clean = [ re . sub ( r"[UZOB]" , "X" , sequence ) for sequence in sep_sequences ] ids = tokenizer . batch_encode_plus ( clean , add_special_tokens = True , pad_to_max_length = True ) input_ids = torch . tensor ( ids [ 'input_ids' ] ) . to ( device ) attention_mask = torch . tensor ( ids [ 'attention_mask' ] ) . to ( device ) with torch . no_grad ( ) : embedding = prottrans_model ( input_ids = input_ids , attention_mask = attention_mask ) [ 0 ] print ( embedding . shape ) return embedding
short_docstring: Embed a single sequence from the tokenizer and prottrans model.
short_docstring_tokens: Embed a single sequence from the tokenizer and prottrans model .
comment: """
      Embed a single sequence from the tokenizer and prottrans model.
      """$SEP$#print(sep_sequences)$SEP$#print(clean)