code: def create_synthetic_data(n, ptrain=0.7):
      """
      Returns "N" instances of a fake language.
  
      Labels are 0/1; 0 -> negative sentiment, 1-> positive sentiment
  
      Creates a nonsense string of positive/negative words with some random subset of them.
  
      :param n: the maximum character (n-1) in the string
      """  # noqa
  
      textdir = str(pathlib.Path(__file__).parent.resolve())
  
      # Pick positive/negative words
      with open(os.path.join(textdir, "pos.txt"), "r") as f:
          pos_list = f.readlines()
          pos_list = [i.strip("\n") for i in pos_list]
  
      with open(os.path.join(textdir, "neg.txt"), "r") as f:
          neg_list = f.readlines()
          neg_list = [i.strip("\n") for i in neg_list]
  
      data = []
      label = []
  
      for i in range(n):
          y = random.randint(0, 1)
  
          # Negative words
          if y == 0:
              word = random.choice(neg_list)
          # Positive words
          else:
              word = random.choice(pos_list)
  
          data.append(word)
          label.append(y)
  
      Ntrain = int(n * ptrain)
      train = pd.DataFrame([data[:Ntrain], label[:Ntrain]]).T
      test = pd.DataFrame([data[Ntrain:], label[Ntrain:]]).T
  
      train.columns = ["text", "label"]
      test.columns = ["text", "label"]
      return train, test
  
imports: import unittest
  import numpy
  import random
  import torch
  from torch.nn.functional import softmax
  from sklearn.metrics import accuracy_score
  from lightwood.encoder import BinaryEncoder, NumericEncoder
  from lightwood.encoder.text import PretrainedLangEncoder
  from type_infer.dtype import dtype
  import pandas
  import os
  import pathlib
label_desc: Use image node_id 1 for calling a global function with example usage: create_synthetic_data(n, ptrain) and returns: train,  test