Downloads · 30 days
25
6% of all-time downloads
SeanLee97/UAE-GIS-Large-V1
UAE-GIS-Large-V1 is a feature extraction model from SeanLee97. Use it when you need embeddings to search or compare text. It is set up for transformers. The card lists the license as mit.
This model is trained on the GIS: Github Issue Similarity dataset using AnglE loss (https://arxiv.org/abs/2309.12871). It can be used for measuring code/issue similarity.
Downloads · 30 days
25
6% of all-time downloads
All-time downloads
420
Public
Parameters
335M
7.4 GB on disk
Likes
2
Public
Click a slice to open those files.
.safetensors670 MB · 100%
From the Hugging Face model README
This model is trained on the GIS: Github Issue Similarity dataset using AnglE loss (https://arxiv.org/abs/2309.12871). It can be used for measuring code/issue similarity.
Results (test set):
python -m pip install -U angle-emb
from scipy import spatial
from angle_emb import AnglE
model = AnglE.from_pretrained('SeanLee97/UAE-GIS-Large-V1').cuda()
quick_sort = '''# Approach 2: Quicksort using list comprehension
def quicksort(arr):
if len(arr) <= 1:
return arr
else:
pivot = arr[0]
left = [x for x in arr[1:] if x < pivot]
right = [x for x in arr[1:] if x >= pivot]
return quicksort(left) + [pivot] + quicksort(right)
# Example usage
arr = [1, 7, 4, 1, 10, 9, -2]
sorted_arr = quicksort(arr)
print("Sorted Array in Ascending Order:")
print(sorted_arr)'''
bubble_sort = '''def bubblesort(elements):
# Looping from size of array from last index[-1] to index [0]
for n in range(len(elements)-1, 0, -1):
swapped = False
for i in range(n):
if elements[i] > elements[i + 1]:
swapped = True
# swapping data if the element is less than next element in the array
elements[i], elements[i + 1] = elements[i + 1], elements[i]
if not swapped:
# exiting the function if we didn't make a single swap
# meaning that the array is already sorted.
return
elements = [39, 12, 18, 85, 72, 10, 2, 18]
print("Unsorted list is,")
print(elements)
bubblesort(elements)
print("Sorted Array is, ")
print(elements)'''
vecs = model.encode([
'def echo(): print("hello world")',
quick_sort,
bubble_sort
])
print('cos sim (0, 1):', 1 - spatial.distance.cosine(vecs[0], vecs[1]))
print('cos sim (0, 2)', 1 - spatial.distance.cosine(vecs[0], vecs[2]))
print('cos sim (1, 2):', 1 - spatial.distance.cosine(vecs[1], vecs[2]))
output:
cos sim (0, 1): 0.34329649806022644
cos sim (0, 2) 0.3627094626426697
cos sim (1, 2): 0.6972219347953796
@article{li2023angle,
title={AnglE-optimized Text Embeddings},
author={Li, Xianming and Li, Jing},
journal={arXiv preprint arXiv:2309.12871},
year={2023}
}