How to use hreyulog/multilingual-e5-small-arkts with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("hreyulog/multilingual-e5-small-arkts") sentences = [ "query: 获取mock数据的json名称 \n功能描述: 本示例介绍了@ohos.multimedia.media组件和@ohos.window接口以及使用触摸热区实现视频横竖屏切换及进度条热区拖动的功能\n\n推荐场景: 横竖屏视频等媒体播放场景\n\n核心组件:\n1. AVPlayer\n\n实现步骤:\n1. 初始化@ohos.multimedia.media的AVPlayer。\n2. 当AVPlayer初始化完毕进入initialized状态时,将XComponent和AVPlayer通过surfaceId绑定。\n3. 使用AVPlayer中的width和height属性判断是横屏视频还是竖屏视频,方便判断是否需要展示全屏观看按钮。\n4. 调用@ohos.window的 getLastWindow 方法获取当前应用内最上层的子窗口\n5. 利用获取到的窗口对象,调用 setWindowSystemBarEnable 方法设置窗口是否显示导航栏和状态栏。\n6. 调用窗口对象的 setPreferredOrientation 方法设置窗口旋转方向以及是否应用重力感应。\n7. 调用窗口对象的setWindowLayoutFullScreen方法实现沉浸式布局。\n8. 对进度条整个组件设置触摸热区。", "passage:\npath: CommonAppDevelopment/feature/videoscreendirectionswitching/src/main/ets/view/VideoScreenDirectionSwitching.ets\nidentifier: VideoScreenDirectionSwitchingComponent\ncode: @Component\nexport struct VideoScreenDirectionSwitchingComponent {\n @State contentData: FlowItemContentsData = new FlowItemContentsData(); // 瀑布流内容\n @State selectedVideo: string = ''; // 选择的视频名称\n @State selectedIndex: number = 0; // 选择的视频index\n @State isLandscape: boolean = false; // 是否横屏状态\n @State isLandscapeStart: boolean = false; // 是否开始横屏动画\n @State statusHeight: number = 0; // 系统状态栏高度\n @State bottomHeight: number = 0; // 系统导航栏高度\n windowClass?: window.Window;\n\n async aboutToAppear() {\n // 进入沉浸式\n this.windowClass = await window.getLastWindow(getContext(this));\n let sysBarProps: window.SystemBarProperties = {\n statusBarContentColor: '#FFFFFF'\n };\n this.windowClass?.setWindowSystemBarProperties(sysBarProps);\n this.statusHeight = this.windowClass.getWindowAvoidArea(window.AvoidAreaType.TYPE_SYSTEM).topRect.height;\n this.bottomHeight = this.windowClass.getWindowAvoidArea(window.AvoidAreaType.TYPE_NAVIGATION_INDICATOR).bottomRect.height;\n this.windowClass.setWindowLayoutFullScreen(true);\n // 获取JSON中的列表数据\n const jsonObj: JsonObject = new JsonObject(JSON_URI);\n const array = await jsonObj.getFlowItemContentObj();\n this.contentData.pushDat", "passage:\npath: core/designsystem/src/main/ets/component/Column.ets\nidentifier: \ncode: build(): void {\n ColumnBase({\n options: this.options,\n justifyContent: FlexAlign.SpaceEvenly,\n alignItems: HorizontalAlign.End,\n widthValue: this.widthValue,\n heightValue: this.heightValue,\n sizeValue: this.sizeValue,\n paddingValue: this.paddingValue,\n marginValue: this.marginValue,\n fillMaxSize: this.fillMaxSize,\n bgColor: this.bgColor,\n onTap: this.onTap,\n content: this.content\n });\n }", "passage:\npath: code/Solutions/IM/Chat/features/chatlist/src/main/ets/utils/DataFactory.ets\nidentifier: \ncode: export async function getChatModelObjFromJSON(MockDataFileDir: string): Promise<Array<ChatModel>> {\n Logger.info(TAG, 'getChatModelObjFromJSON');\n let jsonObj: JsonObject = new JsonObject(MockDataFileDir);\n return await jsonObj.getChatModelObj(MockDataFileDir);\n}" ] embeddings = model.encode(sentences) similarities = model.similarity(embeddings, embeddings) print(similarities.shape) # [4, 4]
The community tab is the place to discuss and collaborate with the HF community!