"""NLP pipeline utility functionality"""
import os

def remove_ext(fname):
    """Removes the extension from a filename
    """
    bn = os.path.basename(fname)
    return os.path.splitext(bn)[0]


def create_dirs(fname):
    """Create (output) directories if they don't exist
    """
    fname = os.path.dirname(fname)

    if not os.path.exists(fname):
        os.makedirs(fname)

def out_file_name(out_dir, fname, ext):
    fname = remove_ext(fname)
    return os.path.join(out_dir, '{}.{}'.format(fname, ext))

"""NLP pipeline utility functionality"""
import os

def remove_ext(fname):
    """Removes the extension from a filename
    """
    bn = os.path.basename(fname)
    return os.path.splitext(bn)[0]


def create_dirs(fname):
    """Create (output) directories if they don't exist
    """
    fname = os.path.dirname(os.path.abspath(fname))

    if not os.path.exists(fname):
        os.makedirs(fname)

def out_file_name(out_dir, fname, ext):
    fname = remove_ext(fname)
    return os.path.join(out_dir, '{}.{}'.format(fname, ext))

Update createdirs to determine the absolute path of files
Update createdirs to determine the absolute path of files

  """NLP pipeline utility functionality"""
  import os
  
  def remove_ext(fname):
      """Removes the extension from a filename
      """
      bn = os.path.basename(fname)
      return os.path.splitext(bn)[0]
  
  
  def create_dirs(fname):
      """Create (output) directories if they don't exist
      """
-     fname = os.path.dirname(fname)
+     fname = os.path.dirname(os.path.abspath(fname))
  
      if not os.path.exists(fname):
          os.makedirs(fname)
  
  def out_file_name(out_dir, fname, ext):
      fname = remove_ext(fname)
      return os.path.join(out_dir, '{}.{}'.format(fname, ext))
  
Update createdirs to determine the absolute path of files
## Code Before:
"""NLP pipeline utility functionality"""
import os

def remove_ext(fname):
    """Removes the extension from a filename
    """
    bn = os.path.basename(fname)
    return os.path.splitext(bn)[0]


def create_dirs(fname):
    """Create (output) directories if they don't exist
    """
    fname = os.path.dirname(fname)

    if not os.path.exists(fname):
        os.makedirs(fname)

def out_file_name(out_dir, fname, ext):
    fname = remove_ext(fname)
    return os.path.join(out_dir, '{}.{}'.format(fname, ext))

## Instruction:
Update createdirs to determine the absolute path of files
## Code After:
"""NLP pipeline utility functionality"""
import os

def remove_ext(fname):
    """Removes the extension from a filename
    """
    bn = os.path.basename(fname)
    return os.path.splitext(bn)[0]


def create_dirs(fname):
    """Create (output) directories if they don't exist
    """
    fname = os.path.dirname(os.path.abspath(fname))

    if not os.path.exists(fname):
        os.makedirs(fname)

def out_file_name(out_dir, fname, ext):
    fname = remove_ext(fname)
    return os.path.join(out_dir, '{}.{}'.format(fname, ext))
