<commit_before>
import sys
import os
import codecs

import kindred

def saveDataFromSTFormat(data,predictedRelations,txtPath,a1Path,a2Path):
	assert isinstance(data,kindred.RelationData)

	with codecs.open(txtPath,'w','utf8') as txtFile, open(a1Path,'w') as a1File, open(a2Path,'w') as a2File:
		txtFile.write(data.getText())
		
		for e in data.getEntities():
			assert isinstance(e,kindred.Entity)
		
			positions = " ".join("%d %d" % (start,end) for start,end in e.position)
			line = "%s\t%s %s\t%s" % (e.sourceEntityID,e.entityType,positions,e.text)
			a1File.write(line+"\n")
			
		entityIDsToSourceEntityIDs = data.getEntityIDsToSourceEntityIDs()	<commit_msg>Fix unicode issue"<commit_after>
import sys
import os
import codecs

import kindred

def saveDataFromSTFormat(data,predictedRelations,txtPath,a1Path,a2Path):
	assert isinstance(data,kindred.RelationData)

	with codecs.open(txtPath,'w','utf8') as txtFile, codecs.open(a1Path,'w','utf8') as a1File, codecs.open(a2Path,'w','utf8') as a2File:
		txtFile.write(data.getText())
		
		for e in data.getEntities():
			assert isinstance(e,kindred.Entity)
		
			positions = " ".join("%d %d" % (start,end) for start,end in e.position)
			line = "%s\t%s %s\t%s" % (e.sourceEntityID,e.entityType,positions,e.text)
			a1File.write(line+"\n")
			
		entityIDsToSourceEntityIDs = data.getEntityIDsToSourceEntityIDs()	
{'fraction_non_alphanumeric': 0.14600146735143066, 'fraction_numerical': 0.013206162876008804, 'mean_word_length': 5.6536585365853655, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1647686', 'n_tokens_mistral': 543, 'n_tokens_neox': 497, 'n_words': 92}