def parse_example(sample, verbose=False):
    """Parse samples into comment, premises, hypothesis, relation and validity."""

    # Split sample into lines
    lines = sample.split('\n')
    
    # Discard empty lines 
    lines = [line.strip() for line in lines if line.strip() != '']
    
    # Get sample comment
    sample_comment = lines[0]
    
    # Get premises (starting with -)
    premises = [line.split('-')[1].strip() for line in lines 
                if line.startswith('-')]

    # Get hypothesis
    hypothesis = lines[-3]
    hypothesis = hypothesis.split(':')[1].strip()
    
    # Get relation
    relation = lines[-2]
    relation = relation.split(':')[1].strip()
    
    # Get validity
    validity = lines[-1]
    validity = validity.split(':')[1].strip()
      
    # Print sample
    if verbose:
        
        print('\nExample', sample_comment)
        print('Premises:')
        for prem in premises:
            print('-', prem)
                
        print('Hypothesis:',hypothesis)
        print('Relation:',relation)
        print('Validity:',validity)
           
    # Return segmented and clean parts of sample
    return sample_comment, premises, hypothesis, relation, validity