chore(8.0): final pre-RC1 sweep — API consistency, named errors, orphans, zero-cast codebase
This commit is contained in:
parent
970e08c466
commit
1f7e365a4e
237 changed files with 1951 additions and 49413 deletions
|
|
@ -3,7 +3,7 @@
|
|||
* Uses embeddings and similarity matching for accurate type detection
|
||||
*
|
||||
* Now powered by SmartExtractor for ultra-neural classification
|
||||
* PRODUCTION-READY with caching support
|
||||
* Entity extraction with caching support
|
||||
*/
|
||||
|
||||
import { NounType } from '../types/graphTypes.js'
|
||||
|
|
@ -293,8 +293,8 @@ export class NeuralEntityExtractor {
|
|||
const contextLower = context.toLowerCase()
|
||||
let boost = 0
|
||||
|
||||
// Context clues for each type
|
||||
const contextClues: Record<NounType, string[]> = {
|
||||
// Context clues for each type (partial: only types with known clue words)
|
||||
const contextClues: Partial<Record<NounType, string[]>> = {
|
||||
[NounType.Person]: ['mr', 'ms', 'mrs', 'dr', 'prof', 'said', 'told', 'wrote'],
|
||||
[NounType.Organization]: ['inc', 'corp', 'llc', 'ltd', 'company', 'announced'],
|
||||
[NounType.Location]: ['in', 'at', 'from', 'to', 'near', 'located', 'city', 'country'],
|
||||
|
|
@ -304,7 +304,7 @@ export class NeuralEntityExtractor {
|
|||
[NounType.Currency]: ['$', '€', '£', '¥', 'usd', 'eur', 'price', 'cost'],
|
||||
[NounType.Message]: ['email', 'message', 'sent', 'received', 'wrote', 'reply'],
|
||||
// Add more context clues as needed
|
||||
} as any
|
||||
}
|
||||
|
||||
const clues = contextClues[type] || []
|
||||
for (const clue of clues) {
|
||||
|
|
@ -401,8 +401,8 @@ export class NeuralEntityExtractor {
|
|||
this.embeddingCacheStats.misses++
|
||||
|
||||
let vector: Vector
|
||||
if ('embed' in this.brain && typeof (this.brain as any).embed === 'function') {
|
||||
vector = await (this.brain as any).embed(text)
|
||||
if ('embed' in this.brain && typeof this.brain.embed === 'function') {
|
||||
vector = await this.brain.embed(text)
|
||||
} else {
|
||||
// Fallback - create simple hash-based vector
|
||||
vector = new Array(384).fill(0)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue