fix: ui of picker component, enhance NLU model

This commit is contained in:
alikia2x 2024-07-13 14:48:45 +08:00
parent bfcf76fdc2
commit 2265344952
5 changed files with 8 additions and 10 deletions

View File

@ -117,8 +117,8 @@ const PickerList = React.forwardRef<HTMLDivElement, PickerListProps>((props, ref
return createPortal( return createPortal(
<div <div
ref={ref} ref={ref}
className="absolute w-fit text-white opacity-0 duration-200 className="absolute w-fit text-black dark:text-white opacity-0 duration-200
bg-gray-300 dark:bg-zinc-700 px-2 py-2 rounded-xl text-align-left scale-[.85]" bg-zinc-50 shadow-lg border-1 border-zinc-200 dark:border-zinc-600 dark:bg-zinc-700 px-2 py-2 rounded-xl text-align-left scale-[.85]"
style={{ transformOrigin: "top center" }} style={{ transformOrigin: "top center" }}
> >
{Object.keys(selectionItems).map((key: string, index) => { {Object.keys(selectionItems).map((key: string, index) => {
@ -126,7 +126,7 @@ const PickerList = React.forwardRef<HTMLDivElement, PickerListProps>((props, ref
<div <div
key={index} key={index}
className="relative py-2 w-full min-w-32 pl-2 cursor-pointer rounded-lg className="relative py-2 w-full min-w-32 pl-2 cursor-pointer rounded-lg
hover:bg-zinc-400 dark:hover:bg-zinc-600 flex justify-between items-center" hover:bg-zinc-200 dark:hover:bg-zinc-600 flex justify-between items-center"
onClick={() => { onClick={() => {
selectionOnChange(key); selectionOnChange(key);
props.toggleDisplay(); props.toggleDisplay();

View File

@ -119,6 +119,9 @@
"None": [ "None": [
"你好", "你好",
"为什么计算机使用二进制" "为什么计算机使用二进制",
"什么是",
"热",
"怎么"
] ]
} }

View File

@ -56,11 +56,6 @@ export async function trainIntentionModel() {
await manager.train(); await manager.train();
// let actual = await manager.process("en", "base64 decode bilibili");
// console.log(actual);
// let actualZH = await manager.process("zh", "去除百分号");
// console.log(actualZH);
const resultModel = manager.toJSON(); const resultModel = manager.toJSON();
const buf = fflate.strToU8(JSON.stringify(resultModel)); const buf = fflate.strToU8(JSON.stringify(resultModel));

View File

@ -1,7 +1,7 @@
{ {
"name": "sparkhome", "name": "sparkhome",
"private": false, "private": false,
"version": "5.2.0", "version": "5.2.1",
"type": "module", "type": "module",
"scripts": { "scripts": {
"dev": "bun server.ts", "dev": "bun server.ts",

Binary file not shown.